Fixing a bug: There is a non-generic class with genericSignature present inside.
authorrtrimana <rtrimana@uci.edu>
Thu, 20 Jun 2019 18:42:39 +0000 (11:42 -0700)
committerrtrimana <rtrimana@uci.edu>
Thu, 20 Jun 2019 18:42:39 +0000 (11:42 -0700)
src/main/gov/nasa/jpf/vm/ClassInfo.java
src/main/gov/nasa/jpf/vm/MethodInfo.java

index 2cb50ad51094a43cb9712bbb5a48442bc90294c4..eaaa3d01b2fddab8291709213d92452469d40636 100644 (file)
@@ -2601,9 +2601,12 @@ 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
+    // 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 new String[0];
+    if (!genericSignature.contains(":"))
+      return new String[0];
     return Types.getGenericTypeVariableNames(genericSignature);
   }
 }
index a5dc27ae7093bb1ad148f6fda7d1c4e1c82bcea9..4b8f9ffa1eb9669b27642e42120c0d8996362d85 100644 (file)
@@ -505,9 +505,12 @@ 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
+    // 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 getArgumentTypeNames();
+    if (!genericSignature.contains(":"))
+      return new String[0];
     return Types.getArgumentTypeNames(genericSignature);
   }
 
@@ -593,6 +596,8 @@ public class MethodInfo extends InfoObject implements GenericSignatureHolder  {
     // TODO: in the class file.
     if (genericSignature == null || genericSignature.equals("") || genericSignature.contains("<*>"))
       return Types.getReturnTypeName(signature);
+    if (!genericSignature.contains(":"))
+      return Types.getReturnTypeName(signature);
     return Types.getGenericReturnTypeName(genericSignature);
   }