From 2b66092a806d138821519d64f00675c1b8556789 Mon Sep 17 00:00:00 2001 From: Stephen Kim Date: Sat, 2 Sep 2006 07:27:13 +0000 Subject: [PATCH] fix inheritance issue again with interfaces git-svn-id: https://svn.apache.org/repos/asf/incubator/openjpa/trunk@439554 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/openjpa/meta/InheritanceComparator.java | 2 ++ .../apache/openjpa/meta/MetaDataInheritanceComparator.java | 5 +---- 2 files changed, 3 insertions(+), 4 deletions(-) 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(); } }