summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/modules/common-java
diff options
context:
space:
mode:
authorrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2011-12-02 18:55:36 +0000
committerrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2011-12-02 18:55:36 +0000
commit1ee87f0f4c14a106c7b37eef7aa218ed95a337b1 (patch)
tree99e02ee701e18738bcfe6eea759b96c56a5d502c /sca-java-2.x/trunk/modules/common-java
parentf37a2fbbdc9a296727c533194a7f6fb90904d367 (diff)
Add ablity to specify endpoint descriptions in node.xml for local domain registry
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1209634 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/common-java')
-rw-r--r--sca-java-2.x/trunk/modules/common-java/src/main/java/org/apache/tuscany/sca/common/java/reflection/JavaIntrospectionHelper.java10
-rw-r--r--sca-java-2.x/trunk/modules/common-java/src/test/java/org/apache/tuscany/sca/common/java/reflection/JavaIntrospectionHelperTestCase.java3
2 files changed, 8 insertions, 5 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
diff --git a/sca-java-2.x/trunk/modules/common-java/src/test/java/org/apache/tuscany/sca/common/java/reflection/JavaIntrospectionHelperTestCase.java b/sca-java-2.x/trunk/modules/common-java/src/test/java/org/apache/tuscany/sca/common/java/reflection/JavaIntrospectionHelperTestCase.java
index 11931a354f..25d694a9d7 100644
--- a/sca-java-2.x/trunk/modules/common-java/src/test/java/org/apache/tuscany/sca/common/java/reflection/JavaIntrospectionHelperTestCase.java
+++ b/sca-java-2.x/trunk/modules/common-java/src/test/java/org/apache/tuscany/sca/common/java/reflection/JavaIntrospectionHelperTestCase.java
@@ -21,6 +21,7 @@ package org.apache.tuscany.sca.common.java.reflection;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
+import java.util.List;
import java.util.Set;
import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry;
@@ -56,7 +57,7 @@ public class JavaIntrospectionHelperTestCase {
@Test
public void testGetAllInterfaces() {
- Set<Class<?>> interfaces = helper.getAllInterfaces(SubTestImpl.class);
+ List<Class<?>> interfaces = helper.getAllInterfaces(SubTestImpl.class);
System.out.println(interfaces);
}