tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dblev...@apache.org
Subject svn commit: r751378 - /openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/util/Debug.java
Date Sun, 08 Mar 2009 06:54:35 GMT
Author: dblevins
Date: Sun Mar  8 06:54:35 2009
New Revision: 751378

URL: http://svn.apache.org/viewvc?rev=751378&view=rev
Log:
extra debug method to collect all fields of any scope

Modified:
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/util/Debug.java

Modified: openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/util/Debug.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/util/Debug.java?rev=751378&r1=751377&r2=751378&view=diff
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/util/Debug.java
(original)
+++ openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/util/Debug.java
Sun Mar  8 06:54:35 2009
@@ -21,6 +21,11 @@
 import java.util.Map;
 import java.util.Map.Entry;
 import java.util.TreeMap;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.lang.reflect.Field;
 import javax.naming.Binding;
 import javax.naming.Context;
 import javax.naming.NamingEnumeration;
@@ -80,4 +85,16 @@
         }
         return map;
     }
+
+    public static List<Field> getFields(Class clazz){
+        if (clazz == null) return Collections.EMPTY_LIST;
+
+        List<Field> fields = new ArrayList<Field>();
+
+        fields.addAll(Arrays.asList(clazz.getDeclaredFields()));
+
+        fields.addAll(getFields(clazz.getSuperclass()));
+
+        return fields;
+    }
 }



Mime
View raw message