Working example of class instantiation.
[jpf-core.git] / src / peers / gov / nasa / jpf / vm / JPF_java_lang_Class.java
index aac8d229f0e49c5742699f7899dd5fc4312806de..0d817c2e73d105361508f57a0fb2969f0618ddc3 100644 (file)
@@ -113,15 +113,15 @@ public class JPF_java_lang_Class extends NativePeer {
   // TODO: THIS NEEDS TO BE SUBSTITUTED BY THE PROPER METHODS! VERY DIRTY RIGHT NOW!
   @MJI
   public int getTypeParameters_____3Ljava_lang_reflect_TypeVariable_2 (MJIEnv env, int robj){
-    ClassInfo ci = env.getReferredClassInfo( robj);
-    AnnotationInfo[] ai = ci.getAnnotations();
+    ClassLoaderInfo cli = env.getSystemClassLoaderInfo();
+    ClassInfo rci = cli.getResolvedClassInfo("sun.reflect.generics.reflectiveObjects.TypeVariableImpl");
+    // TODO: Need to 1) Just create the object of TypeVariableImpl, 2) Declare class type and name only, 3) Return the
+    //  object reference back to the caller
+    ClassInfo test = cli.getResolvedClassInfo("java.lang.Class");
+    ClassInfo tci = env.getReferredClassInfo( robj);
+    int ei = env.newObject(test);
 
-    try {
-      return env.newAnnotationProxies(ai);
-    } catch (ClinitRequired x){
-      env.handleClinitRequest(x.getRequiredClassInfo());
-      return MJIEnv.NULL;
-    }
+    return MJIEnv.NULL;
   }
   
   @MJI