Adding ParameterizedTypeImpl to getGenericSuperclass method.
[jpf-core.git] / src / main / gov / nasa / jpf / vm / MethodInfo.java
index a4880c748dac81ac6a2a5313847140888bd16eae..4176f686ee88b4339c8080f64be06016dfa8dad2 100644 (file)
@@ -502,7 +502,18 @@ public class MethodInfo extends InfoObject implements GenericSignatureHolder  {
   public String[] getArgumentTypeNames () {
     return Types.getArgumentTypeNames(signature);
   }
-  
+
+  // TODO: Fix for Groovy's model-checking
+  public String[] getArgumentGenericTypeNames () {
+    // 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();
+    // 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 () {
     if (argSize < 0) {
       argSize = Types.getArgumentsSize(signature);
@@ -579,7 +590,15 @@ public class MethodInfo extends InfoObject implements GenericSignatureHolder  {
   public String getReturnTypeName () {
     return Types.getReturnTypeName(signature);
   }
-  
+
+  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);
+  }
+
   public String getSourceFileName () {
     if (ci != null) {
       return ci.getSourceFileName();