Upgrading/adapting fixes to Groovy 2.5.7 from Groovy 2.4.8.
authorrtrimana <rtrimana@uci.edu>
Wed, 26 Jun 2019 18:54:50 +0000 (11:54 -0700)
committerrtrimana <rtrimana@uci.edu>
Wed, 26 Jun 2019 18:54:50 +0000 (11:54 -0700)
examples/Empty.groovy
examples/Reflection.java
src/classes/java/lang/Class.java
src/classes/java/lang/Thread.java
src/classes/java/lang/reflect/Method.java
src/classes/sun/reflect/generics/reflectiveObjects/GenericArrayTypeImpl.java
src/classes/sun/reflect/generics/reflectiveObjects/ParameterizedTypeImpl.java
src/classes/sun/reflect/generics/reflectiveObjects/TypeVariableImpl.java
src/classes/sun/reflect/generics/reflectiveObjects/WildcardTypeImpl.java
src/peers/gov/nasa/jpf/vm/JPF_java_lang_Thread.java

index 1b7beeb64134a756dd93fe2b24c6690167c1002e..4c130beb00c341293b3ef1514acd28143e5b1460 100644 (file)
@@ -4,25 +4,28 @@ class Empty {
        def installed() {
                // This is a standard debug statement in Groovy
                //log.debug "Installed with settings: ${settings}"
-               int x = 5;
-               int y = 6;
-               int result = x + y;
-               return result;
+               //int x = 5;
+               //int y = 6;
+               //int result = x + y;
+               //return result;
+               println "installed() is called!"
                //initialize()
        }
 
        // This function is where you initialize callbacks for event listeners
-       //def initialize() {
+       def initialize() {
                // The subscribe function takes a input, a state, and a callback method
                //subscribe(contact, "contact.open", openHandler)
                //subscribe(contact, "contact.closed", closedHandler)
-       //}
+               println "initialize() is called!"
+       }
 
        static void main(String[] args) {               
 
                //Empty emp = new Empty();
                //int result = emp.installed();
                //println result;
-               println "Test"
+               //emp.installed()
+               println "End of call!"
        }       
 }
index ff80688c30bd7d95355d512ae95e293d6420a072..cc13e07e069be7a9237ace41e186d4a6eee041d8 100644 (file)
@@ -177,7 +177,7 @@ public class Reflection {
       Type returnType = method.getGenericReturnType();
       System.out.println(returnType);*/
       
-      /* TODO: Enumerate all methods in Class.class
+      /* TODO: Enumerate all methods in Class.class */
       Method[] methods = Class.class.getMethods();
       for(Method mth : methods) {
                  System.out.println("===========================");
@@ -189,7 +189,7 @@ public class Reflection {
                  System.out.println();
                  Type returnType = mth.getGenericReturnType();
                  System.out.println(returnType + "\n");
-      }*/
+      }
 
       /*Class[] parameterTypes = methods[0].getParameterTypes();
       for(Class parameterType: parameterTypes){
index 00a55b0c1cc890d3958c1d41f4579737d4a75f1a..3d21d022d4db30f67b5915cd9a015021a424ae73 100644 (file)
@@ -349,6 +349,9 @@ public final class Class<T> implements Serializable, GenericDeclaration, Type, A
     throw new UnsupportedOperationException();
   }
 
+  // TODO: Fix for Groovy's model-checking
+  transient ClassValue.ClassValueMap classValueMap;
+
   public boolean isSynthetic (){
     final int SYNTHETIC = 0x00001000;
     return (getModifiers() & SYNTHETIC) != 0;
index 8c538f590e350434dcf5d59f688036036435b976..c9fff91678db92a20d0cbf473dd4cea5495e2bcd 100644 (file)
@@ -71,7 +71,7 @@ public class Thread implements Runnable {
 
   // used to store Thread.stop() exceptions
   Throwable stopException;
-  
+
   private volatile UncaughtExceptionHandler uncaughtExceptionHandler; // null by default
 
   
@@ -144,8 +144,13 @@ public class Thread implements Runnable {
     init0(this.group, target, this.name, stackSize);
     
     initThreadLocals(cur);
+
+    // TODO: Fix for Groovy's model-checking
+    this.tid = this.getId();
   }
 
+  private long tid;
+
   // this takes care of ThreadInfo initialization
   native void init0 (ThreadGroup group, Runnable target, String name, long stackSize);
   
index cc6f57bd58d2ebc5058843ec222d27dd452f000b..a24a30e5799b4860f96a53b037cc1efc2619a873 100644 (file)
@@ -41,9 +41,9 @@ public final class Method extends AccessibleObject implements Member {
   public native int getModifiers();
   public native Class<?> getReturnType();
   public native Class<?>[] getParameterTypes();
-  public native Type[] getGenericParameterTypes();
   public native Class<?>[] getExceptionTypes();
   // TODO: Fix for Groovy's model-checking
+  public native Type[] getGenericParameterTypes();
   public native Type getGenericReturnType();
 
   @Override
index 1d8063b753cae5740af22f7f6ba9b584768a2ab6..ad0bca981bf4bb5ce7ef9a4fc06e90dc39be9761 100644 (file)
@@ -4,6 +4,7 @@ import java.lang.reflect.GenericArrayType;
 import java.lang.reflect.Type;
 import java.util.Objects;
 
+// TODO: Fix for Groovy's model-checking
 /**
  * MJI model class for sun.reflect.generics.reflectiveObjects.GenericArrayTypeImpl
  *
index 6b105e6aea5f358b57d72eb73cf72d7b64951879..809dbf4b7d7186b31b020db133e377717043af3e 100644 (file)
@@ -10,6 +10,7 @@ import java.lang.reflect.TypeVariable;
 import java.util.Arrays;
 import java.util.Objects;
 
+// TODO: Fix for Groovy's model-checking
 /**
  * MJI model class for sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl
  *
index 56a544f2cda8295343716e798cd182ce2c2df90d..a10eb8752899f132ef4ba1e96846a18dd1638f5e 100644 (file)
@@ -11,6 +11,7 @@ import java.util.Objects;
 import sun.reflect.generics.factory.GenericsFactory;
 import sun.reflect.generics.tree.FieldTypeSignature;
 
+// TODO: Fix for Groovy's model-checking
 /**
  * MJI model class for sun.reflect.generics.reflectiveObjects.TypeVariableImpl
  *
index 865c202c35a075a9f9e53c6820622e8b111d817e..5a4fdaf88f9876fd92f8835ac2e9737549e875e7 100644 (file)
@@ -8,7 +8,7 @@ import sun.reflect.generics.tree.FieldTypeSignature;
 import sun.reflect.generics.visitor.Reifier;
 import java.util.Arrays;
 
-
+// TODO: Fix for Groovy's model-checking
 /**
  * MJI model class for sun.reflect.generics.reflectiveObjects.WildcardTypeImpl
  *
index 11362aa9623a2c39142cd68fd0761e065d77ae89..7533a9aa6d2fcb3e25cce24800e8f6bff16dd6d4 100644 (file)
@@ -42,7 +42,8 @@ public class JPF_java_lang_Thread extends NativePeer {
   public void init0__Ljava_lang_ThreadGroup_2Ljava_lang_Runnable_2Ljava_lang_String_2J__V (MJIEnv env,
                          int objRef, int groupRef, int runnableRef, int nameRef, long stackSize) {
     VM vm = env.getVM();
-    
+
+    // TODO: Fix for Groovy's model-checking
     // we only need to create the ThreadInfo - its initialization will take care
     // of proper linkage to the java.lang.Thread object (objRef)
     vm.createThreadInfo( objRef, groupRef, runnableRef, nameRef);