Fixing getGenericReturnType to recognize the GenericArrayTypeImpl and ParameterizedTy...
[jpf-core.git] / examples / Reflection.java
index f446b4bf4644f9e8d27c36b618a11d6504ff28eb..b32715832912b6b30b60dc1e25510a89f5c6cb26 100644 (file)
@@ -73,13 +73,15 @@ public class Reflection {
             System.out.println(interfaces[i]);
         }*/
       
-      Method[] methods = SampleClass.class.getMethods();
-        Method method = null;
-        for(Method mth : methods) {
-            if (mth.getName().equals("setSampleField")) {
-                method = mth;
-            }
+         Method[] methods = Class.class.getMethods();
+         Method method = null;
+      for(Method mth : methods) {
+        //if (mth.getName().equals("getConstructor")) {
+        //if (mth.getName().equals("isAssignableFrom")) {
+        if (mth.getName().equals("getTypeParameters")) {
+           method = mth;
         }
+      }
       Type[] parameters = method.getGenericParameterTypes();
       //Type[] parameters = methods[0].getGenericParameterTypes();
       for (int i = 0; i < parameters.length; i++) {