From: rtrimana Date: Thu, 20 Jun 2019 18:42:39 +0000 (-0700) Subject: Fixing a bug: There is a non-generic class with genericSignature present inside. X-Git-Url: http://plrg.eecs.uci.edu/git/?p=jpf-core.git;a=commitdiff_plain;h=73fe7b28c24f2ebf671dbd724e5954f0378c679d Fixing a bug: There is a non-generic class with genericSignature present inside. --- diff --git a/src/main/gov/nasa/jpf/vm/ClassInfo.java b/src/main/gov/nasa/jpf/vm/ClassInfo.java index 2cb50ad..eaaa3d0 100644 --- a/src/main/gov/nasa/jpf/vm/ClassInfo.java +++ b/src/main/gov/nasa/jpf/vm/ClassInfo.java @@ -2601,9 +2601,12 @@ public class ClassInfo extends InfoObject implements Iterable, 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); } } diff --git a/src/main/gov/nasa/jpf/vm/MethodInfo.java b/src/main/gov/nasa/jpf/vm/MethodInfo.java index a5dc27a..4b8f9ff 100644 --- a/src/main/gov/nasa/jpf/vm/MethodInfo.java +++ b/src/main/gov/nasa/jpf/vm/MethodInfo.java @@ -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); }