diff --git a/openjpa-kernel/src/main/java/org/apache/openjpa/meta/InheritanceComparator.java b/openjpa-kernel/src/main/java/org/apache/openjpa/meta/InheritanceComparator.java index 97a726bd1..077b5c86e 100644 --- a/openjpa-kernel/src/main/java/org/apache/openjpa/meta/InheritanceComparator.java +++ b/openjpa-kernel/src/main/java/org/apache/openjpa/meta/InheritanceComparator.java @@ -77,6 +77,8 @@ public class InheritanceComparator * Count the levels of inheritance between this class and our base class. */ private int levels(Class to) { + if (to.isInterface()) + return to.getInterfaces().length; for (int i = 0; to != null; i++, to = to.getSuperclass()) if (to == _base) return i; diff --git a/openjpa-kernel/src/main/java/org/apache/openjpa/meta/MetaDataInheritanceComparator.java b/openjpa-kernel/src/main/java/org/apache/openjpa/meta/MetaDataInheritanceComparator.java index 1c5e0c4d1..65d429048 100644 --- a/openjpa-kernel/src/main/java/org/apache/openjpa/meta/MetaDataInheritanceComparator.java +++ b/openjpa-kernel/src/main/java/org/apache/openjpa/meta/MetaDataInheritanceComparator.java @@ -27,9 +27,6 @@ public class MetaDataInheritanceComparator protected Class toClass(Object elem) { if (elem == null) return null; - ClassMetaData meta = (ClassMetaData) elem; - if (meta.getInterfaceImpl() != null) - return meta.getInterfaceImpl(); - return meta.getDescribedType(); + return ((ClassMetaData) elem).getDescribedType(); } }