From 6c4dacf4e1cf65cb23272eef6743d1c67f7c0a03 Mon Sep 17 00:00:00 2001 From: Eric Milles Date: Wed, 20 Jul 2022 17:51:08 -0500 Subject: [PATCH] Update the Groovy plugin to 4.0.4 for #1381 --- .../tests/search/DGMInferencingTests.java | 4 +- .../search/Groovy25InferencingTests.java | 8 +- .../core/tests/basic/AnnotationsTests.java | 293 ++++-- .../tests/basic/GroovyCompilerTestSuite.java | 2 +- .../core/tests/basic/InnerClassTests.java | 18 +- base/org.codehaus.groovy40/.checkstyle | 1 - base/org.codehaus.groovy40/.classpath | 8 +- .../META-INF/MANIFEST.MF | 174 ++-- base/org.codehaus.groovy40/VERSION | 1 + base/org.codehaus.groovy40/about.html | 22 +- .../lib/console/groovy-console-4.0.3.jar | Bin 793626 -> 0 bytes .../lib/console/groovy-console-4.0.4.jar | Bin 0 -> 882049 bytes ...swing-4.0.3.jar => groovy-swing-4.0.4.jar} | Bin 372192 -> 372209 bytes ...s-4.0.3.jar => groovy-templates-4.0.4.jar} | Bin 95043 -> 95068 bytes ...ovy-xml-4.0.3.jar => groovy-xml-4.0.4.jar} | Bin 230187 -> 230234 bytes ...3-javadoc.jar => groovy-4.0.4-javadoc.jar} | Bin 6723417 -> 6727013 bytes ...3-sources.jar => groovy-4.0.4-sources.jar} | Bin 2563904 -> 2565220 bytes .../{groovy-4.0.3.jar => groovy-4.0.4.jar} | Bin 7379244 -> 7383312 bytes ...adoc.jar => groovy-test-4.0.4-javadoc.jar} | Bin 155460 -> 155458 bytes ...rces.jar => groovy-test-4.0.4-sources.jar} | Bin 43883 -> 43881 bytes ...y-test-4.0.3.jar => groovy-test-4.0.4.jar} | Bin 77575 -> 77585 bytes ...sh-4.0.3.jar => groovy-groovysh-4.0.4.jar} | Bin 474395 -> 476873 bytes base/org.codehaus.groovy40/pom.xml | 2 +- .../org.codehaus.groovy40/src/GroovyParser.g4 | 2 + .../groovy/ast/tools/ExpressionUtils.java | 459 +++++---- .../groovy/parser/antlr4/AstBuilder.java | 260 ++--- .../groovy/parser/antlr4/GroovyParser.interp | 2 +- .../groovy/parser/antlr4/GroovyParser.java | 741 +++++++------- .../parser/antlr4/GroovyParserVisitor.java | 4 +- .../groovy/antlr/AntlrParserPlugin.java | 945 +++++++++--------- .../org/codehaus/groovy/ast/MethodNode.java | 24 +- .../groovy/ast/tools/GenericsUtils.java | 162 ++- .../groovy/classgen/AnnotationVisitor.java | 147 ++- .../groovy/classgen/ExtendedVerifier.java | 72 +- .../codehaus/groovy/classgen/Verifier.java | 19 +- ...cTypesMethodReferenceExpressionWriter.java | 210 ++-- .../groovy/control/ResolveVisitor.java | 129 ++- .../codehaus/groovy/control/SourceUnit.java | 2 + .../RecordTypeASTTransformation.java | 17 +- .../TupleConstructorASTTransformation.java | 15 +- .../stc/StaticTypeCheckingSupport.java | 82 +- .../stc/StaticTypeCheckingVisitor.java | 17 +- .../codehaus/groovy/vmplugin/v8/Java8.java | 743 -------------- .../build.properties | 2 +- extras/groovy-eclipse-compiler-tests/pom.xml | 4 +- .../feature.xml | 2 +- 46 files changed, 2025 insertions(+), 2568 deletions(-) delete mode 100644 base/org.codehaus.groovy40/lib/console/groovy-console-4.0.3.jar create mode 100644 base/org.codehaus.groovy40/lib/console/groovy-console-4.0.4.jar rename base/org.codehaus.groovy40/lib/console/{groovy-swing-4.0.3.jar => groovy-swing-4.0.4.jar} (87%) rename base/org.codehaus.groovy40/lib/console/{groovy-templates-4.0.3.jar => groovy-templates-4.0.4.jar} (90%) rename base/org.codehaus.groovy40/lib/console/{groovy-xml-4.0.3.jar => groovy-xml-4.0.4.jar} (94%) rename base/org.codehaus.groovy40/lib/{groovy-4.0.3-javadoc.jar => groovy-4.0.4-javadoc.jar} (51%) rename base/org.codehaus.groovy40/lib/{groovy-4.0.3-sources.jar => groovy-4.0.4-sources.jar} (80%) rename base/org.codehaus.groovy40/lib/{groovy-4.0.3.jar => groovy-4.0.4.jar} (87%) rename base/org.codehaus.groovy40/lib/{groovy-test-4.0.3-javadoc.jar => groovy-test-4.0.4-javadoc.jar} (61%) rename base/org.codehaus.groovy40/lib/{groovy-test-4.0.3-sources.jar => groovy-test-4.0.4-sources.jar} (93%) rename base/org.codehaus.groovy40/lib/{groovy-test-4.0.3.jar => groovy-test-4.0.4.jar} (88%) rename base/org.codehaus.groovy40/lib/shell/{groovy-groovysh-4.0.3.jar => groovy-groovysh-4.0.4.jar} (62%) delete mode 100644 base/org.codehaus.groovy40/src/org/codehaus/groovy/vmplugin/v8/Java8.java diff --git a/base-test/org.eclipse.jdt.groovy.core.tests.builder/src/org/eclipse/jdt/core/groovy/tests/search/DGMInferencingTests.java b/base-test/org.eclipse.jdt.groovy.core.tests.builder/src/org/eclipse/jdt/core/groovy/tests/search/DGMInferencingTests.java index 0ae7c4ca39..f484907140 100644 --- a/base-test/org.eclipse.jdt.groovy.core.tests.builder/src/org/eclipse/jdt/core/groovy/tests/search/DGMInferencingTests.java +++ b/base-test/org.eclipse.jdt.groovy.core.tests.builder/src/org/eclipse/jdt/core/groovy/tests/search/DGMInferencingTests.java @@ -1085,9 +1085,7 @@ public void testDGMDeclaring6() { @Test // https://github.com/groovy/groovy-eclipse/issues/1002 public void testDGMDeclaring7() { String contents = "['x','y','z'].stream().toList()"; - float version = Float.parseFloat(System.getProperty("java.specification.version")); - assertDeclType(contents, "toList", version > 15 ? "java.util.stream.Stream" - : isAtLeastGroovy(40) ? "org.codehaus.groovy.runtime.StreamGroovyMethods" : "org.codehaus.groovy.vmplugin.v8.PluginDefaultGroovyMethods"); + assertDeclType(contents, "toList", isAtLeastGroovy(40) ? "org.codehaus.groovy.runtime.StreamGroovyMethods" : "org.codehaus.groovy.vmplugin.v8.PluginDefaultGroovyMethods"); } @Test // https://github.com/groovy/groovy-eclipse/issues/1002 diff --git a/base-test/org.eclipse.jdt.groovy.core.tests.builder/src/org/eclipse/jdt/core/groovy/tests/search/Groovy25InferencingTests.java b/base-test/org.eclipse.jdt.groovy.core.tests.builder/src/org/eclipse/jdt/core/groovy/tests/search/Groovy25InferencingTests.java index dac1fdff20..f2e45313a8 100644 --- a/base-test/org.eclipse.jdt.groovy.core.tests.builder/src/org/eclipse/jdt/core/groovy/tests/search/Groovy25InferencingTests.java +++ b/base-test/org.eclipse.jdt.groovy.core.tests.builder/src/org/eclipse/jdt/core/groovy/tests/search/Groovy25InferencingTests.java @@ -63,7 +63,9 @@ public void testCompileStaticVariableAssignment4() { " }\n" + "}\n"; - assertType(contents, "list", "java.util.ArrayList"); + float version = Float.parseFloat(System.getProperty("java.specification.version")); + assertType(contents, "list", "java.util.ArrayList 11 ? " or java.lang.constant.Constable or java.lang.constant.ConstantDesc" : "") + ">"); } @Test @@ -110,6 +112,8 @@ public void testCompileStaticVariableAssignment8() { " }\n" + "}\n"; - assertType(contents, "map", "java.util.LinkedHashMap"); + float version = Float.parseFloat(System.getProperty("java.specification.version")); + assertType(contents, "map", "java.util.LinkedHashMap 11 ? " or java.lang.constant.Constable or java.lang.constant.ConstantDesc" : "") + ">"); } } diff --git a/base-test/org.eclipse.jdt.groovy.core.tests.compiler/src/org/eclipse/jdt/groovy/core/tests/basic/AnnotationsTests.java b/base-test/org.eclipse.jdt.groovy.core.tests.compiler/src/org/eclipse/jdt/groovy/core/tests/basic/AnnotationsTests.java index f7e83488b4..5631929168 100644 --- a/base-test/org.eclipse.jdt.groovy.core.tests.compiler/src/org/eclipse/jdt/groovy/core/tests/basic/AnnotationsTests.java +++ b/base-test/org.eclipse.jdt.groovy.core.tests.compiler/src/org/eclipse/jdt/groovy/core/tests/basic/AnnotationsTests.java @@ -17,7 +17,6 @@ import static org.eclipse.jdt.groovy.core.tests.GroovyBundle.isAtLeastGroovy; -import org.junit.Ignore; import org.junit.Test; public final class AnnotationsTests extends GroovyCompilerTestSuite { @@ -203,7 +202,7 @@ public void testLongLiteralAttributeDefault1b() { runConformTest(sources, "42"); } - @Test @Ignore // https://issues.apache.org/jira/browse/GROOVY-9205 + @Test // https://issues.apache.org/jira/browse/GROOVY-9205 public void testLongLiteralAttributeDefault2() { //@formatter:off String[] sources = { @@ -215,10 +214,20 @@ public void testLongLiteralAttributeDefault2() { }; //@formatter:on - runConformTest(sources, "42"); + if (isAtLeastGroovy(40)) { + runConformTest(sources, "42"); + } else { + runNegativeTest(sources, + "----------\n" + + "1. ERROR in Script.groovy (at line 2)\n" + + "\tlong value() default (long)42\n" + + "\t ^^\n" + + "Groovy:Attribute 'value' should have type 'java.lang.Long'; but found type 'int' in @A\n" + + "----------\n"); + } } - @Test @Ignore // https://issues.apache.org/jira/browse/GROOVY-9205 + @Test // https://issues.apache.org/jira/browse/GROOVY-9205 public void testLongLiteralAttributeDefault2a() { //@formatter:off String[] sources = { @@ -230,7 +239,17 @@ public void testLongLiteralAttributeDefault2a() { }; //@formatter:on - runConformTest(sources, "42"); + if (isAtLeastGroovy(40)) { + runConformTest(sources, "42"); + } else { + runNegativeTest(sources, + "----------\n" + + "1. ERROR in Script.groovy (at line 2)\n" + + "\tlong value() default (42 as long)\n" + + "\t ^^\n" + + "Groovy:Attribute 'value' should have type 'java.lang.Long'; but found type 'int' in @A\n" + + "----------\n"); + } } @Test // https://issues.apache.org/jira/browse/GROOVY-6025 @@ -429,7 +448,7 @@ public void testCharLiteralAttributeDefault3() { } @Test // https://issues.apache.org/jira/browse/GROOVY-6025 - public void testCharLiteralAttributeDefaul4() { + public void testCharLiteralAttributeDefault4() { //@formatter:off String[] sources = { "Script.groovy", @@ -488,7 +507,7 @@ public void testFloatLiteralAttributeDefault1b() { runConformTest(sources, "42.0"); } - @Test @Ignore // https://issues.apache.org/jira/browse/GROOVY-9205 + @Test // https://issues.apache.org/jira/browse/GROOVY-9205 public void testFloatLiteralAttributeDefault2() { //@formatter:off String[] sources = { @@ -500,10 +519,20 @@ public void testFloatLiteralAttributeDefault2() { }; //@formatter:on - runConformTest(sources, "42.0"); + if (isAtLeastGroovy(40)) { + runConformTest(sources, "42.0"); + } else { + runNegativeTest(sources, + "----------\n" + + "1. ERROR in Script.groovy (at line 2)\n" + + "\tfloat value() default (float)42\n" + + "\t ^^\n" + + "Groovy:Attribute 'value' should have type 'java.lang.Float'; but found type 'int' in @A\n" + + "----------\n"); + } } - @Test @Ignore // https://issues.apache.org/jira/browse/GROOVY-9205 + @Test // https://issues.apache.org/jira/browse/GROOVY-9205 public void testFloatLiteralAttributeDefault2a() { //@formatter:off String[] sources = { @@ -515,7 +544,17 @@ public void testFloatLiteralAttributeDefault2a() { }; //@formatter:on - runConformTest(sources, "42.0"); + if (isAtLeastGroovy(40)) { + runConformTest(sources, "42.0"); + } else { + runNegativeTest(sources, + "----------\n" + + "1. ERROR in Script.groovy (at line 2)\n" + + "\tfloat value() default (42 as float)\n" + + "\t ^^\n" + + "Groovy:Attribute 'value' should have type 'java.lang.Float'; but found type 'int' in @A\n" + + "----------\n"); + } } @Test @@ -563,7 +602,7 @@ public void testDoubleLiteralAttributeDefault1b() { runConformTest(sources, "42.0"); } - @Test @Ignore // https://issues.apache.org/jira/browse/GROOVY-9205 + @Test // https://issues.apache.org/jira/browse/GROOVY-9205 public void testDoubleLiteralAttributeDefault2() { //@formatter:off String[] sources = { @@ -575,10 +614,20 @@ public void testDoubleLiteralAttributeDefault2() { }; //@formatter:on - runConformTest(sources, "42.0"); + if (isAtLeastGroovy(40)) { + runConformTest(sources, "42.0"); + } else { + runNegativeTest(sources, + "----------\n" + + "1. ERROR in Script.groovy (at line 2)\n" + + "\tdouble value() default (double)42\n" + + "\t ^^\n" + + "Groovy:Attribute 'value' should have type 'java.lang.Double'; but found type 'int' in @A\n" + + "----------\n"); + } } - @Test @Ignore // https://issues.apache.org/jira/browse/GROOVY-9205 + @Test // https://issues.apache.org/jira/browse/GROOVY-9205 public void testDoubleLiteralAttributeDefault2a() { //@formatter:off String[] sources = { @@ -590,10 +639,52 @@ public void testDoubleLiteralAttributeDefault2a() { }; //@formatter:on - runConformTest(sources, "42.0"); + if (isAtLeastGroovy(40)) { + runConformTest(sources, "42.0"); + } else { + runNegativeTest(sources, + "----------\n" + + "1. ERROR in Script.groovy (at line 2)\n" + + "\tdouble value() default (42 as double)\n" + + "\t ^^\n" + + "Groovy:Attribute 'value' should have type 'java.lang.Double'; but found type 'int' in @A\n" + + "----------\n"); + } + } + + @Test // https://issues.apache.org/jira/browse/GROOVY-9366 + public void testByteLiteralAttributeValue() { + //@formatter:off + String[] sources = { + "EightBits.java", + "import java.lang.annotation.*;\n" + + "@Target(ElementType.FIELD)\n" + + "@interface EightBits {\n" + + " byte value();\n" + + "}\n", + + "Main.groovy", + "class Main {\n" + + " @EightBits(0x1)\n" + + " Object whatever\n" + + "}\n", + }; + //@formatter:on + + if (isAtLeastGroovy(40)) { + runConformTest(sources); + } else { + runNegativeTest(sources, + "----------\n" + + "1. ERROR in Main.groovy (at line 2)\n" + + "\t@EightBits(0x1)\n" + + "\t ^^^\n" + + "Groovy:Attribute 'value' should have type 'java.lang.Byte'; but found type 'int' in @EightBits\n" + + "----------\n"); + } } - @Test @Ignore // https://issues.apache.org/jira/browse/GROOVY-9206 + @Test // https://issues.apache.org/jira/browse/GROOVY-9206 public void testCharLiteralAttributeValue() { //@formatter:off String[] sources = { @@ -602,17 +693,32 @@ public void testCharLiteralAttributeValue() { "@Target(ElementType.FIELD)\n" + "@interface Separator {\n" + " char value();\n" + - "}", + "}\n", "Main.groovy", "class Main {\n" + - " @Separator(';')\n" + + " @Separator((char)';')\n" + " String tokens\n" + - "}", + "}\n", }; //@formatter:on - runConformTest(sources); + if (isAtLeastGroovy(40)) { + runConformTest(sources); + } else { + runNegativeTest(sources, + "----------\n" + + "1. ERROR in Main.groovy (at line 2)\n" + + "\t@Separator((char)';')\n" + + "\t ^^^^^^^^^\n" + + "Groovy:Expected '(char) ;' to be an inline constant of type char in @Separator\n" + + "----------\n" + + "2. ERROR in Main.groovy (at line 2)\n" + + "\t@Separator((char)';')\n" + + "\t ^^^^^^^^^\n" + + "Groovy:Attribute 'value' should have type 'java.lang.Character'; but found type 'java.lang.Object' in @Separator\n" + + "----------\n"); + } } @Test // ArrayIndexOutOfBoundsException in LongLiteral.computeConstant @@ -624,13 +730,13 @@ public void testLongLiteralAttributeValue() { "@Target(ElementType.FIELD)\n" + "@interface Min {\n" + " long value();\n" + - "}", + "}\n", "Main.groovy", "class Main {\n" + " @Min(0L)\n" + " Integer index\n" + - "}", + "}\n", }; //@formatter:on @@ -646,13 +752,13 @@ public void testLongLiteralAttributeValue2() { "@Target(ElementType.FIELD)\n" + "@interface Min {\n" + " long value();\n" + - "}", + "}\n", "Main.groovy", "class Main {\n" + " @Min(+1L)\n" + " Integer index\n" + - "}", + "}\n", }; //@formatter:on @@ -668,19 +774,50 @@ public void testLongLiteralAttributeValue3() { "@Target(ElementType.FIELD)\n" + "@interface Min {\n" + " long value();\n" + - "}", + "}\n", "Main.groovy", "class Main {\n" + " @Min(-1L)\n" + " Integer index\n" + - "}", + "}\n", }; //@formatter:on runConformTest(sources); } + @Test // https://issues.apache.org/jira/browse/GROOVY-7252 + public void testShortLiteralAttributeValue() { + //@formatter:off + String[] sources = { + "Min.java", + "import java.lang.annotation.*;\n" + + "@Target(ElementType.FIELD)\n" + + "@interface Min {\n" + + " short value();\n" + + "}\n", + + "Main.groovy", + "class Main {\n" + + " @Min(-1) short index\n" + + "}\n", + }; + //@formatter:on + + if (isAtLeastGroovy(40)) { + runConformTest(sources); + } else { + runNegativeTest(sources, + "----------\n" + + "1. ERROR in Main.groovy (at line 2)\n" + + "\t@Min(-1) short index\n" + + "\t ^^\n" + + "Groovy:Attribute 'value' should have type 'java.lang.Short'; but found type 'int' in @Min\n" + + "----------\n"); + } + } + @Test public void testBigIntegerLiteralAttributeValue() { //@formatter:off @@ -690,13 +827,13 @@ public void testBigIntegerLiteralAttributeValue() { "@Target(ElementType.FIELD)\n" + "@interface Min {\n" + " long value();\n" + - "}", + "}\n", "Main.groovy", "class Main {\n" + " @Min(0G)\n" + " Integer index\n" + - "}", + "}\n", }; //@formatter:on @@ -723,23 +860,27 @@ public void testBigDecimalLiteralAttributeValue() { "@Target(ElementType.FIELD)\n" + "@interface Min {\n" + " double value();\n" + - "}", + "}\n", "Main.groovy", "class Main {\n" + " @Min(1.1G)\n" + " BigDecimal index\n" + - "}", + "}\n", }; //@formatter:on - runNegativeTest(sources, - "----------\n" + - "1. ERROR in Main.groovy (at line 2)\n" + - "\t@Min(1.1G)\n" + - "\t ^^^^\n" + - "Groovy:Attribute 'value' should have type 'java.lang.Double'; but found type 'java.math.BigDecimal' in @Min\n" + - "----------\n"); + if (isAtLeastGroovy(40)) { + runConformTest(sources); + } else { + runNegativeTest(sources, + "----------\n" + + "1. ERROR in Main.groovy (at line 2)\n" + + "\t@Min(1.1G)\n" + + "\t ^^^^\n" + + "Groovy:Attribute 'value' should have type 'java.lang.Double'; but found type 'java.math.BigDecimal' in @Min\n" + + "----------\n"); + } } @Test @@ -749,7 +890,7 @@ public void testBooleanLiteralAttributeValue() { "Main.groovy", "@SuppressWarnings(value=\"nls\", unknown=false)\n" + "class Main {\n" + - "}", + "}\n", }; //@formatter:on @@ -758,7 +899,7 @@ public void testBooleanLiteralAttributeValue() { "1. ERROR in Main.groovy (at line 1)\n" + "\t@SuppressWarnings(value=\"nls\", unknown=false)\n" + "\t^^^^^^^^^^^^^^^^^\n" + - "Groovy:'unknown'is not part of the annotation SuppressWarnings in @java.lang.SuppressWarnings\n" + + "Groovy:'unknown'" + (isAtLeastGroovy(40) ? " " : "") + "is not part of the annotation SuppressWarnings in @java.lang.SuppressWarnings\n" + "----------\n" + "2. ERROR in Main.groovy (at line 1)\n" + "\t@SuppressWarnings(value=\"nls\", unknown=false)\n" + @@ -782,12 +923,12 @@ public void testClassLiteralAttributeValue1() { "@Target(ElementType.TYPE)\n" + "@interface Anno {\n" + " Class value();\n" + - "}", + "}\n", "Main.groovy", "@Anno(URL.class)\n" + "class Main {\n" + - "}", + "}\n", }; //@formatter:on @@ -804,12 +945,12 @@ public void testClassLiteralAttributeValue2() { "@Target(ElementType.TYPE)\n" + "@interface Anno {\n" + " Class value();\n" + - "}", + "}\n", "Main.groovy", "@Anno(URL)\n" + "class Main {\n" + - "}", + "}\n", }; //@formatter:on @@ -826,14 +967,14 @@ public void testClassLiteralAttributeValue3() { "@Target(ElementType.TYPE)\n" + "@interface Anno {\n" + " Class value();\n" + - "}", + "}\n", "Main.groovy", "@Anno(\n" + " java.net.URL\n" + ")\n" + "class Main {\n" + - "}", + "}\n", }; //@formatter:on @@ -985,7 +1126,7 @@ public void testInlinedStaticFinalAttributeValue() { " public static void main(String[] argv) {\n" + " System.out.print(XXX.class.getAnnotation(Anno.class));\n" + " }\n" + - "}", + "}\n", "B.groovy", "import java.lang.annotation.*\n" + @@ -994,7 +1135,7 @@ public void testInlinedStaticFinalAttributeValue() { "@Retention(RetentionPolicy.RUNTIME)\n" + "@interface Anno {\n" + " String value()\n" + - "}", + "}\n", }; //@formatter:on @@ -1009,12 +1150,12 @@ public void testInlinedStaticFinalAttributeValue2() { "Const.java", "public class Const {\n" + " public static final String ABC = \"abc\";\n" + - "}", + "}\n", "Script.groovy", "@SuppressWarnings(value = Const.ABC)\n" + "void meth() {\n" + - "}", + "}\n", }; //@formatter:on @@ -1027,6 +1168,40 @@ public void testInlinedStaticFinalAttributeValue2() { "----------\n"); } + @Test // https://issues.apache.org/jira/browse/GROOVY-10068 + public void testInlinedStaticFinalAttributeValue3() { + //@formatter:off + String[] sources = { + "Script.groovy", + "@Tag(Val.ONE)\n" + + "def m() {\n" + + "}\n", + + "Tag.java", + "public @interface Tag {\n" + + " short value();\n" + + "}\n", + + "Val.groovy", + "class Val {\n" + + " public static final short ONE = 1;\n" + + "}\n", + }; + //@formatter:on + + if (isAtLeastGroovy(40)) { + runConformTest(sources); + } else { + runNegativeTest(sources, + "----------\n" + + "1. ERROR in Script.groovy (at line -1)\n" + // TODO: line number + "\t@Tag(Val.ONE)\n" + + "\t^\n" + + "Groovy:Attribute 'value' should have type 'java.lang.Short'; but found type 'java.lang.Integer' in @Tag\n" + + "----------\n"); + } + } + @Test // GRECLIPSE-830 public void testDoubleAttributeWithBigDecimalValue() { //@formatter:off @@ -1038,7 +1213,7 @@ public void testDoubleAttributeWithBigDecimalValue() { "@interface AnnotationDouble {\n" + " String value()\n" + " double width() default 5.0d\n" + - "}", + "}\n", "AnnotationDoubleTest.groovy", "final class AnnotationDoubleTest {\n" + @@ -1046,17 +1221,21 @@ public void testDoubleAttributeWithBigDecimalValue() { " @AnnotationDouble(value='test', width=1.0) double value\n" + " }\n" + " def test = new AnnotationDoubleTest()\n" + - "}", + "}\n", }; //@formatter:on - runNegativeTest(sources, - "----------\n" + - "1. ERROR in AnnotationDoubleTest.groovy (at line 3)\n" + - "\t@AnnotationDouble(value='test', width=1.0) double value\n" + - "\t ^^^\n" + - "Groovy:Attribute 'width' should have type 'java.lang.Double'; but found type 'java.math.BigDecimal' in @AnnotationDouble\n" + - "----------\n"); + if (isAtLeastGroovy(40)) { + runConformTest(sources); + } else { + runNegativeTest(sources, + "----------\n" + + "1. ERROR in AnnotationDoubleTest.groovy (at line 3)\n" + + "\t@AnnotationDouble(value='test', width=1.0) double value\n" + + "\t ^^^\n" + + "Groovy:Attribute 'width' should have type 'java.lang.Double'; but found type 'java.math.BigDecimal' in @AnnotationDouble\n" + + "----------\n"); + } } @Test diff --git a/base-test/org.eclipse.jdt.groovy.core.tests.compiler/src/org/eclipse/jdt/groovy/core/tests/basic/GroovyCompilerTestSuite.java b/base-test/org.eclipse.jdt.groovy.core.tests.compiler/src/org/eclipse/jdt/groovy/core/tests/basic/GroovyCompilerTestSuite.java index b802b1bf06..8830f1cf79 100644 --- a/base-test/org.eclipse.jdt.groovy.core.tests.compiler/src/org/eclipse/jdt/groovy/core/tests/basic/GroovyCompilerTestSuite.java +++ b/base-test/org.eclipse.jdt.groovy.core.tests.compiler/src/org/eclipse/jdt/groovy/core/tests/basic/GroovyCompilerTestSuite.java @@ -133,7 +133,7 @@ protected String[] getDefaultClassPaths() { String[] cps = super.getDefaultClassPaths(); String[] newcps = Arrays.copyOf(cps, cps.length + 2); - String[] groovyVersions = {"4.0.3", "3.0.12-indy", "2.5.18-indy"}; + String[] groovyVersions = {"4.0.4", "3.0.12-indy", "2.5.18-indy"}; String[] ivyVersions = {"2.5.0", "2.4.0"}; try { URL groovyJar = null; diff --git a/base-test/org.eclipse.jdt.groovy.core.tests.compiler/src/org/eclipse/jdt/groovy/core/tests/basic/InnerClassTests.java b/base-test/org.eclipse.jdt.groovy.core.tests.compiler/src/org/eclipse/jdt/groovy/core/tests/basic/InnerClassTests.java index 1e6209e232..a54c05c77c 100644 --- a/base-test/org.eclipse.jdt.groovy.core.tests.compiler/src/org/eclipse/jdt/groovy/core/tests/basic/InnerClassTests.java +++ b/base-test/org.eclipse.jdt.groovy.core.tests.compiler/src/org/eclipse/jdt/groovy/core/tests/basic/InnerClassTests.java @@ -248,13 +248,17 @@ public void testInnerClass2() { }; //@formatter:on - runNegativeTest(sources, - "----------\n" + - "1. ERROR in Outer.groovy (at line 3)\n" + - "\tstatic {\n" + - "\t ^\n" + - "Cannot define static initializer in inner type Outer.Inner\n" + // https://docs.oracle.com/javase/specs/jls/se7/html/jls-8.html#jls-8.1.3 - "----------\n"); + if (isAtLeastJava(JDK16)) { + runConformTest(sources); + } else { + runNegativeTest(sources, + "----------\n" + + "1. ERROR in Outer.groovy (at line 3)\n" + + "\tstatic {\n" + + "\t ^\n" + + "Cannot define static initializer in inner type Outer.Inner\n" + // https://docs.oracle.com/javase/specs/jls/se7/html/jls-8.html#jls-8.1.3 + "----------\n"); + } } @Test diff --git a/base/org.codehaus.groovy40/.checkstyle b/base/org.codehaus.groovy40/.checkstyle index d48ff241e5..4f23d7ea1b 100644 --- a/base/org.codehaus.groovy40/.checkstyle +++ b/base/org.codehaus.groovy40/.checkstyle @@ -64,7 +64,6 @@ - diff --git a/base/org.codehaus.groovy40/.classpath b/base/org.codehaus.groovy40/.classpath index 3dca30624d..9da9c01bc5 100644 --- a/base/org.codehaus.groovy40/.classpath +++ b/base/org.codehaus.groovy40/.classpath @@ -11,14 +11,14 @@ - + - + - + - + diff --git a/base/org.codehaus.groovy40/META-INF/MANIFEST.MF b/base/org.codehaus.groovy40/META-INF/MANIFEST.MF index db5feb5d79..c1b5ac0660 100644 --- a/base/org.codehaus.groovy40/META-INF/MANIFEST.MF +++ b/base/org.codehaus.groovy40/META-INF/MANIFEST.MF @@ -4,99 +4,99 @@ Bundle-SymbolicName: org.codehaus.groovy Automatic-Module-Name: org.codehaus.groovy Bundle-Name: Apache Groovy Bundle-Vendor: Pivotal Software, Inc. -Bundle-Version: 4.0.3.qualifier +Bundle-Version: 4.0.4.qualifier Bundle-ClassPath: eclipse-trace.jar, groovy-eclipse.jar, groovy-parser2.jar, lib/ivy-2.5.0.jar, - lib/groovy-4.0.3.jar, - lib/groovy-test-4.0.3.jar -Export-Package: groovy.beans;version="4.0.3", - groovy.cli;version="4.0.3", - groovy.grape;version="4.0.3", - groovy.inspect;version="4.0.3", - groovy.io;version="4.0.3", - groovy.lang;version="4.0.3", - groovy.lang.groovydoc;version="4.0.3", - groovy.mock.interceptor;version="4.0.3", - groovy.namespace;version="4.0.3", - groovy.security;version="4.0.3", - groovy.test;version="4.0.3", - groovy.time;version="4.0.3", - groovy.transform;version="4.0.3", - groovy.transform.builder;version="4.0.3", - groovy.transform.options;version="4.0.3", - groovy.transform.stc;version="4.0.3", - groovy.ui;version="4.0.3", - groovy.util;version="4.0.3", - groovy.util.logging;version="4.0.3", + lib/groovy-4.0.4.jar, + lib/groovy-test-4.0.4.jar +Export-Package: groovy.beans;version="4.0.4", + groovy.cli;version="4.0.4", + groovy.grape;version="4.0.4", + groovy.inspect;version="4.0.4", + groovy.io;version="4.0.4", + groovy.lang;version="4.0.4", + groovy.lang.groovydoc;version="4.0.4", + groovy.mock.interceptor;version="4.0.4", + groovy.namespace;version="4.0.4", + groovy.security;version="4.0.4", + groovy.test;version="4.0.4", + groovy.time;version="4.0.4", + groovy.transform;version="4.0.4", + groovy.transform.builder;version="4.0.4", + groovy.transform.options;version="4.0.4", + groovy.transform.stc;version="4.0.4", + groovy.ui;version="4.0.4", + groovy.util;version="4.0.4", + groovy.util.logging;version="4.0.4", groovyjarjarantlr;x-friends:="org.codehaus.groovy.eclipse.refactoring", - org.apache.groovy.antlr;version="4.0.3", - org.apache.groovy.ast.tools;version="4.0.3", - org.apache.groovy.io;version="4.0.3", - org.apache.groovy.lang;version="4.0.3", - org.apache.groovy.lang.annotation;version="4.0.3", - org.apache.groovy.metaclass;version="4.0.3", - org.apache.groovy.plugin;version="4.0.3", - org.apache.groovy.test;version="4.0.3", - org.apache.groovy.test.transform;version="4.0.3", - org.apache.groovy.util;version="4.0.3", - org.apache.groovy.util.concurrent;version="4.0.3", - org.codehaus.groovy;version="4.0.3", - org.codehaus.groovy.antlr;version="4.0.3", - org.codehaus.groovy.antlr.parser;version="4.0.3", - org.codehaus.groovy.ast;version="4.0.3", - org.codehaus.groovy.ast.builder;version="4.0.3", - org.codehaus.groovy.ast.decompiled;version="4.0.3", - org.codehaus.groovy.ast.expr;version="4.0.3", - org.codehaus.groovy.ast.stmt;version="4.0.3", - org.codehaus.groovy.ast.tools;version="4.0.3", - org.codehaus.groovy.classgen;version="4.0.3", - org.codehaus.groovy.classgen.asm;version="4.0.3", - org.codehaus.groovy.classgen.asm.indy;version="4.0.3", - org.codehaus.groovy.classgen.asm.indy.sc;version="4.0.3", - org.codehaus.groovy.classgen.asm.sc;version="4.0.3", - org.codehaus.groovy.classgen.asm.util;version="4.0.3", - org.codehaus.groovy.control;version="4.0.3", - org.codehaus.groovy.control.customizers;version="4.0.3", - org.codehaus.groovy.control.customizers.builder;version="4.0.3", - org.codehaus.groovy.control.io;version="4.0.3", - org.codehaus.groovy.control.messages;version="4.0.3", + org.apache.groovy.antlr;version="4.0.4", + org.apache.groovy.ast.tools;version="4.0.4", + org.apache.groovy.io;version="4.0.4", + org.apache.groovy.lang;version="4.0.4", + org.apache.groovy.lang.annotation;version="4.0.4", + org.apache.groovy.metaclass;version="4.0.4", + org.apache.groovy.plugin;version="4.0.4", + org.apache.groovy.test;version="4.0.4", + org.apache.groovy.test.transform;version="4.0.4", + org.apache.groovy.util;version="4.0.4", + org.apache.groovy.util.concurrent;version="4.0.4", + org.codehaus.groovy;version="4.0.4", + org.codehaus.groovy.antlr;version="4.0.4", + org.codehaus.groovy.antlr.parser;version="4.0.4", + org.codehaus.groovy.ast;version="4.0.4", + org.codehaus.groovy.ast.builder;version="4.0.4", + org.codehaus.groovy.ast.decompiled;version="4.0.4", + org.codehaus.groovy.ast.expr;version="4.0.4", + org.codehaus.groovy.ast.stmt;version="4.0.4", + org.codehaus.groovy.ast.tools;version="4.0.4", + org.codehaus.groovy.classgen;version="4.0.4", + org.codehaus.groovy.classgen.asm;version="4.0.4", + org.codehaus.groovy.classgen.asm.indy;version="4.0.4", + org.codehaus.groovy.classgen.asm.indy.sc;version="4.0.4", + org.codehaus.groovy.classgen.asm.sc;version="4.0.4", + org.codehaus.groovy.classgen.asm.util;version="4.0.4", + org.codehaus.groovy.control;version="4.0.4", + org.codehaus.groovy.control.customizers;version="4.0.4", + org.codehaus.groovy.control.customizers.builder;version="4.0.4", + org.codehaus.groovy.control.io;version="4.0.4", + org.codehaus.groovy.control.messages;version="4.0.4", org.codehaus.groovy.eclipse, - org.codehaus.groovy.reflection;version="4.0.3", - org.codehaus.groovy.reflection.android;version="4.0.3", - org.codehaus.groovy.reflection.stdclasses;version="4.0.3", - org.codehaus.groovy.reflection.v7;version="4.0.3", - org.codehaus.groovy.runtime;version="4.0.3", - org.codehaus.groovy.runtime.callsite;version="4.0.3", - org.codehaus.groovy.runtime.dgmimpl;version="4.0.3", - org.codehaus.groovy.runtime.dgmimpl.arrays;version="4.0.3", - org.codehaus.groovy.runtime.m12n;version="4.0.3", - org.codehaus.groovy.runtime.memoize;version="4.0.3", - org.codehaus.groovy.runtime.metaclass;version="4.0.3", - org.codehaus.groovy.runtime.powerassert;version="4.0.3", - org.codehaus.groovy.runtime.typehandling;version="4.0.3", - org.codehaus.groovy.runtime.wrappers;version="4.0.3", - org.codehaus.groovy.syntax;version="4.0.3", - org.codehaus.groovy.tools;version="4.0.3", - org.codehaus.groovy.tools.ast;version="4.0.3", - org.codehaus.groovy.tools.gse;version="4.0.3", - org.codehaus.groovy.tools.javac;version="4.0.3", - org.codehaus.groovy.tools.shell;version="4.0.3", - org.codehaus.groovy.tools.shell.util;version="4.0.3", - org.codehaus.groovy.transform;version="4.0.3", - org.codehaus.groovy.transform.sc;version="4.0.3", - org.codehaus.groovy.transform.sc.transformers;version="4.0.3", - org.codehaus.groovy.transform.stc;version="4.0.3", - org.codehaus.groovy.transform.tailrec;version="4.0.3", - org.codehaus.groovy.transform.trait;version="4.0.3", - org.codehaus.groovy.util;version="4.0.3", - org.codehaus.groovy.vmplugin;version="4.0.3", - org.codehaus.groovy.vmplugin.v7;version="4.0.3", - org.codehaus.groovy.vmplugin.v8;version="4.0.3", - org.codehaus.groovy.vmplugin.v9;version="4.0.3", - org.codehaus.groovy.vmplugin.v10;version="4.0.3", - org.codehaus.groovy.vmplugin.v16;version="4.0.3" + org.codehaus.groovy.reflection;version="4.0.4", + org.codehaus.groovy.reflection.android;version="4.0.4", + org.codehaus.groovy.reflection.stdclasses;version="4.0.4", + org.codehaus.groovy.reflection.v7;version="4.0.4", + org.codehaus.groovy.runtime;version="4.0.4", + org.codehaus.groovy.runtime.callsite;version="4.0.4", + org.codehaus.groovy.runtime.dgmimpl;version="4.0.4", + org.codehaus.groovy.runtime.dgmimpl.arrays;version="4.0.4", + org.codehaus.groovy.runtime.m12n;version="4.0.4", + org.codehaus.groovy.runtime.memoize;version="4.0.4", + org.codehaus.groovy.runtime.metaclass;version="4.0.4", + org.codehaus.groovy.runtime.powerassert;version="4.0.4", + org.codehaus.groovy.runtime.typehandling;version="4.0.4", + org.codehaus.groovy.runtime.wrappers;version="4.0.4", + org.codehaus.groovy.syntax;version="4.0.4", + org.codehaus.groovy.tools;version="4.0.4", + org.codehaus.groovy.tools.ast;version="4.0.4", + org.codehaus.groovy.tools.gse;version="4.0.4", + org.codehaus.groovy.tools.javac;version="4.0.4", + org.codehaus.groovy.tools.shell;version="4.0.4", + org.codehaus.groovy.tools.shell.util;version="4.0.4", + org.codehaus.groovy.transform;version="4.0.4", + org.codehaus.groovy.transform.sc;version="4.0.4", + org.codehaus.groovy.transform.sc.transformers;version="4.0.4", + org.codehaus.groovy.transform.stc;version="4.0.4", + org.codehaus.groovy.transform.tailrec;version="4.0.4", + org.codehaus.groovy.transform.trait;version="4.0.4", + org.codehaus.groovy.util;version="4.0.4", + org.codehaus.groovy.vmplugin;version="4.0.4", + org.codehaus.groovy.vmplugin.v7;version="4.0.4", + org.codehaus.groovy.vmplugin.v8;version="4.0.4", + org.codehaus.groovy.vmplugin.v9;version="4.0.4", + org.codehaus.groovy.vmplugin.v10;version="4.0.4", + org.codehaus.groovy.vmplugin.v16;version="4.0.4" Require-Bundle: org.eclipse.core.runtime, org.junit;resolution:=optional Bundle-RequiredExecutionEnvironment: JavaSE-1.8 diff --git a/base/org.codehaus.groovy40/VERSION b/base/org.codehaus.groovy40/VERSION index 27e15804b8..26cdcc6e16 100644 --- a/base/org.codehaus.groovy40/VERSION +++ b/base/org.codehaus.groovy40/VERSION @@ -8,3 +8,4 @@ 2022-03-03: GROOVY_4_0_1 2022-04-19: GROOVY_4_0_2 2022-05-30: GROOVY_4_0_3 +2022-07-20: GROOVY_4_0_4 diff --git a/base/org.codehaus.groovy40/about.html b/base/org.codehaus.groovy40/about.html index 18bb17b577..89e42b3733 100644 --- a/base/org.codehaus.groovy40/about.html +++ b/base/org.codehaus.groovy40/about.html @@ -24,12 +24,12 @@

License

Third Party Content

-

groovy-4.0.3.jar

-

groovy-test-4.0.3.jar

+

groovy-4.0.4.jar

+

groovy-test-4.0.4.jar

-

groovy-console-4.0.3.jar

-

groovy-groovysh-4.0.3.jar

-

groovy-swing-4.0.3.jar

-

groovy-templates-4.0.3.jar

-

groovy-xml-4.0.3.jar

+

groovy-console-4.0.4.jar

+

groovy-groovysh-4.0.4.jar

+

groovy-swing-4.0.4.jar

+

groovy-templates-4.0.4.jar

+

groovy-xml-4.0.4.jar

javaparser-core-3.24.2.jar