New problem with Groovy library.
authorrtrimana <rtrimana@uci.edu>
Wed, 19 Jun 2019 20:08:46 +0000 (13:08 -0700)
committerrtrimana <rtrimana@uci.edu>
Wed, 19 Jun 2019 20:08:46 +0000 (13:08 -0700)
examples/Empty.groovy [new file with mode: 0644]
src/classes/sun/reflect/generics/reflectiveObjects/TypeVariableImpl.java
src/main/gov/nasa/jpf/vm/ClassInfo.java
src/main/gov/nasa/jpf/vm/MethodInfo.java

diff --git a/examples/Empty.groovy b/examples/Empty.groovy
new file mode 100644 (file)
index 0000000..8d1f874
--- /dev/null
@@ -0,0 +1,9 @@
+class Empty {
+
+       public static void main(String... args) {
+               /*int rand = Math.random()*10
+               int test = 10;
+               double test2 = 0.0;*/
+
+       }       
+}
index fcb0521e2c8bb6436c9599cb154de9a8ecf57153..c77a3a516323003565c5b07e88c8a9594c372d62 100644 (file)
@@ -59,9 +59,10 @@ public class TypeVariableImpl<D extends GenericDeclaration>
         return new TypeVariableImpl<T>(decl, name, bs, f);
     }
 
-
     public Type[] getBounds() {
+
         throw new UnsupportedOperationException();
+        //return new Type[0];
     }
 
     public D getGenericDeclaration(){
index 3d5ff58145eeaecb92e5d5c57b7a12baac959a94..2cb50ad51094a43cb9712bbb5a48442bc90294c4 100644 (file)
@@ -2602,7 +2602,7 @@ public class ClassInfo extends InfoObject implements Iterable<MethodInfo>, Gener
   // TODO: Fix for Groovy's model-checking
   public String[] getGenericTypeVariableNames () {
     // To accommodate methods that do not have generic types
-    if (genericSignature == null || genericSignature.equals(""))
+    if (genericSignature == null || genericSignature.equals("") || genericSignature.contains("<*>"))
       return new String[0];
     return Types.getGenericTypeVariableNames(genericSignature);
   }
index 4c904b732caaec2cf089e69f67de487acc309c03..a5dc27ae7093bb1ad148f6fda7d1c4e1c82bcea9 100644 (file)
@@ -506,7 +506,7 @@ public class MethodInfo extends InfoObject implements GenericSignatureHolder  {
   // TODO: Fix for Groovy's model-checking
   public String[] getArgumentGenericTypeNames () {
     // To accommodate methods that do not have generic types
-    if (genericSignature == null || genericSignature.equals(""))
+    if (genericSignature == null || genericSignature.equals("") || genericSignature.contains("<*>"))
       return getArgumentTypeNames();
     return Types.getArgumentTypeNames(genericSignature);
   }
@@ -589,7 +589,9 @@ public class MethodInfo extends InfoObject implements GenericSignatureHolder  {
   }
 
   public String getGenericReturnTypeName () {
-    if (genericSignature == null || genericSignature.equals(""))
+    // TODO: We need to double check but for some reason Groovy has a type of generic signature with "<*>"
+    // TODO: in the class file.
+    if (genericSignature == null || genericSignature.equals("") || genericSignature.contains("<*>"))
       return Types.getReturnTypeName(signature);
     return Types.getGenericReturnTypeName(genericSignature);
   }