Fixing a bug: getWildcardTypeImplObject could not recognize variations of class Type...
[jpf-core.git] / src / main / gov / nasa / jpf / vm / Types.java
index fcc8ec24b49bc5e9dce3886d60b4c7c661cda6d5..c0edb793f6b50be7e2425f34571dda6231862d6b 100644 (file)
@@ -1317,16 +1317,16 @@ public class Types {
       return signature;
     }
 
-    // Check that the first and the second halves are the same, e.g., TT for Class<T>
-    int halfPos = cleanSig.length()/2;
-    String firstHalf = cleanSig.substring(0, halfPos);
-    String secondHalf = cleanSig.substring(halfPos, cleanSig.length());
-    if (firstHalf.equals(secondHalf)) {
-      return firstHalf;
-    } else {
-      // This is probably a class, e.g., +java.lang.Class
+    // Check if this is not a class name, e.g., +java.lang.Class
+    if (cleanSig.contains(".")) {
       return signature;
     }
+
+    // Just return the second half of the signature to get the Type parameter
+    int halfPos = cleanSig.length()/2;
+    //String firstHalf = cleanSig.substring(0, halfPos);
+    String secondHalf = cleanSig.substring(halfPos, cleanSig.length());
+    return secondHalf;
   }
   // TODO: Fix for Groovy's model-checking
 }