diff options
Diffstat (limited to 'sca-java-2.x/trunk/modules/common-java/src/main')
-rw-r--r-- | sca-java-2.x/trunk/modules/common-java/src/main/java/org/apache/tuscany/sca/common/java/reflection/JavaIntrospectionHelper.java | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sca-java-2.x/trunk/modules/common-java/src/main/java/org/apache/tuscany/sca/common/java/reflection/JavaIntrospectionHelper.java b/sca-java-2.x/trunk/modules/common-java/src/main/java/org/apache/tuscany/sca/common/java/reflection/JavaIntrospectionHelper.java index ae4f01c032..73ff2e2fb0 100644 --- a/sca-java-2.x/trunk/modules/common-java/src/main/java/org/apache/tuscany/sca/common/java/reflection/JavaIntrospectionHelper.java +++ b/sca-java-2.x/trunk/modules/common-java/src/main/java/org/apache/tuscany/sca/common/java/reflection/JavaIntrospectionHelper.java @@ -504,16 +504,18 @@ public final class JavaIntrospectionHelper { * Returns the set of interfaces implemented by the given class and its * ancestors or a blank set if none */ - public Set<Class<?>> getAllInterfaces(Class<?> clazz) { - Set<Class<?>> implemented = new HashSet<Class<?>>(); + public List<Class<?>> getAllInterfaces(Class<?> clazz) { + List<Class<?>> implemented = new ArrayList<Class<?>>(); getAllInterfaces(clazz, implemented); return implemented; } - private static void getAllInterfaces(Class<?> clazz, Set<Class<?>> implemented) { + private static void getAllInterfaces(Class<?> clazz, List<Class<?>> implemented) { Class<?>[] interfaces = clazz.getInterfaces(); for (Class<?> interfaze : interfaces) { - implemented.add(interfaze); + if (!implemented.contains(interfaze)) { + implemented.add(interfaze); + } } Class<?> superClass = clazz.getSuperclass(); // Object has no superclass so check for null |