- //ClassInfo rci = cli.getResolvedClassInfo("sun.reflect.generics.reflectiveObjects.Test");
- // 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
- int tvRef = env.newObject(ci);
- ElementInfo ei = env.getModifiableElementInfo(tvRef);
-
- ClassInfo tci = env.getReferredClassInfo( robj);
- //ei.setReferenceField("genericDeclaration", env.newObject(tci.getName() + ".class"));
- ei.setReferenceField("name", env.newString("TUVW"));
- int aRef = env.newObjectArray("Ljava/lang/reflect/TypeVariable;", 1);
- for (int i = 0; i < 1; i++) {
- env.setReferenceArrayElement(aRef, i, tvRef);
+ int[] var = new int[typeVars.length];
+
+ for(int i = 0; i < typeVars.length; i++) {
+ int typeVarRef = env.newObject(ci);
+ ElementInfo ei = env.getModifiableElementInfo(typeVarRef);
+ ei.setReferenceField("genericDeclaration", tci.getClassObjectRef());
+ ei.setReferenceField("name", env.newString(typeVars[i]));
+ var[i] = typeVarRef;
+ }
+ int aRef = env.newObjectArray("Ljava/lang/reflect/TypeVariable;", typeVars.length);
+
+ // Set references for every array element
+ for (int i = 0; i < typeVars.length; i++) {
+ env.setReferenceArrayElement(aRef, i, var[i]);