Adding WildcardTypeImpl class.
[jpf-core.git] / examples / Reflection.java
index 21fdd5763aad5b00d8b15b8672de93fb746237eb..bebd776c874bdd839e0329b36f32c8b7f673a92a 100644 (file)
@@ -61,14 +61,28 @@ public class Reflection {
          System.out.println(parameters[i]);
       }
       System.out.println();*/
-      Type superCls = Generic.class.getGenericSuperclass();
+      /*Type superCls = Generic.class.getGenericSuperclass();
       //Type superCls = String.class.getGenericSuperclass();
       System.out.println(superCls);
         System.out.println();
         Type[] interfaces = Generic.class.getGenericInterfaces();
         for (int i = 0; i < interfaces.length; i++) {
             System.out.println(interfaces[i]);
+        }*/
+      
+      Method[] methods = Class.class.getMethods();
+        Method method = null;
+        for(Method mth : methods) {
+            if (mth.getName().equals("isAnnotationPresent")) {
+                method = mth;
+            }
         }
+      Type[] parameters = method.getGenericParameterTypes();
+      //Type[] parameters = methods[0].getGenericParameterTypes();
+      for (int i = 0; i < parameters.length; i++) {
+         System.out.println(parameters[i]);
+      }
+      System.out.println();
       /*Class[] parameterTypes = methods[0].getParameterTypes();
       for(Class parameterType: parameterTypes){
          System.out.println(parameterType.getName());