[OLINGO-403] Fix

This commit is contained in:
Francesco Chicchiriccò 2014-08-13 17:53:10 +02:00
parent 0a80d5146b
commit 977905919c

View File

@ -56,16 +56,14 @@ public class EntityUUID implements Serializable {
if (type == null || !Serializable.class.isAssignableFrom(type)) { if (type == null || !Serializable.class.isAssignableFrom(type)) {
throw new IllegalArgumentException("Invalid Entity type class: " + type); throw new IllegalArgumentException("Invalid Entity type class: " + type);
} }
if (this.type == null) {
for (Class<?> clazz : ClassUtils.hierarchy(type, ClassUtils.Interfaces.INCLUDE)) { for (Class<?> clazz : ClassUtils.hierarchy(type, ClassUtils.Interfaces.INCLUDE)) {
if (this.type == null if (ArrayUtils.contains(clazz.getInterfaces(), EntityType.class)) {
&& (clazz.getInterfaces().length == 0
|| ArrayUtils.contains(clazz.getInterfaces(), Serializable.class)
|| ArrayUtils.contains(clazz.getInterfaces(), EntityType.class))) {
this.type = clazz; this.type = clazz;
} }
} }
} }
}
public URI getEntitySetURI() { public URI getEntitySetURI() {
return entitySetURI; return entitySetURI;