From: rtrimana Date: Wed, 19 Jun 2019 20:08:46 +0000 (-0700) Subject: New problem with Groovy library. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=16698d90f70e3870d3f641df93ab052e662ba184;p=jpf-core.git New problem with Groovy library. --- diff --git a/examples/Empty.groovy b/examples/Empty.groovy new file mode 100644 index 0000000..8d1f874 --- /dev/null +++ b/examples/Empty.groovy @@ -0,0 +1,9 @@ +class Empty { + + public static void main(String... args) { + /*int rand = Math.random()*10 + int test = 10; + double test2 = 0.0;*/ + + } +} diff --git a/src/classes/sun/reflect/generics/reflectiveObjects/TypeVariableImpl.java b/src/classes/sun/reflect/generics/reflectiveObjects/TypeVariableImpl.java index fcb0521..c77a3a5 100644 --- a/src/classes/sun/reflect/generics/reflectiveObjects/TypeVariableImpl.java +++ b/src/classes/sun/reflect/generics/reflectiveObjects/TypeVariableImpl.java @@ -59,9 +59,10 @@ public class TypeVariableImpl return new TypeVariableImpl(decl, name, bs, f); } - public Type[] getBounds() { + throw new UnsupportedOperationException(); + //return new Type[0]; } public D getGenericDeclaration(){ diff --git a/src/main/gov/nasa/jpf/vm/ClassInfo.java b/src/main/gov/nasa/jpf/vm/ClassInfo.java index 3d5ff58..2cb50ad 100644 --- a/src/main/gov/nasa/jpf/vm/ClassInfo.java +++ b/src/main/gov/nasa/jpf/vm/ClassInfo.java @@ -2602,7 +2602,7 @@ 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 - if (genericSignature == null || genericSignature.equals("")) + if (genericSignature == null || genericSignature.equals("") || 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 4c904b7..a5dc27a 100644 --- a/src/main/gov/nasa/jpf/vm/MethodInfo.java +++ b/src/main/gov/nasa/jpf/vm/MethodInfo.java @@ -506,7 +506,7 @@ 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 || genericSignature.equals("")) + if (genericSignature == null || genericSignature.equals("") || genericSignature.contains("<*>")) return getArgumentTypeNames(); return Types.getArgumentTypeNames(genericSignature); } @@ -589,7 +589,9 @@ public class MethodInfo extends InfoObject implements GenericSignatureHolder { } public String getGenericReturnTypeName () { - if (genericSignature == null || genericSignature.equals("")) + // 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); }