From 73fe7b28c24f2ebf671dbd724e5954f0378c679d Mon Sep 17 00:00:00 2001 From: rtrimana Date: Thu, 20 Jun 2019 11:42:39 -0700 Subject: [PATCH] Fixing a bug: There is a non-generic class with genericSignature present inside. --- src/main/gov/nasa/jpf/vm/ClassInfo.java | 5 ++++- src/main/gov/nasa/jpf/vm/MethodInfo.java | 7 ++++++- 2 files changed, 10 insertions(+), 2 deletions(-) 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); } -- 2.34.1