Adding ParameterizedTypeImpl to getGenericSuperclass method.
[jpf-core.git] / src / main / gov / nasa / jpf / vm / MethodInfo.java
index ce7828183e7e0873baa648bf06cc0eed0b090678..4176f686ee88b4339c8080f64be06016dfa8dad2 100644 (file)
@@ -505,10 +505,13 @@ 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)
+    // 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();
-    return Types.getArgumentTypeNames(genericSignature);
+    // We need to first find the start of the method parameters in the signature
+    String methodParameters = genericSignature.substring(genericSignature.indexOf('('));
+    return Types.getArgumentTypeNames(methodParameters);
   }
 
   public int getArgumentsSize () {
@@ -589,6 +592,10 @@ public class MethodInfo extends InfoObject implements GenericSignatureHolder  {
   }
 
   public String getGenericReturnTypeName () {
+    // 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);
   }