[Git][java-team/groovy][upstream] New upstream version 2.4.17
Emmanuel Bourg
gitlab at salsa.debian.org
Mon Jul 15 12:40:57 BST 2019
Emmanuel Bourg pushed to branch upstream at Debian Java Maintainers / groovy
Commits:
55bd2a07 by Emmanuel Bourg at 2019-07-15T09:25:34Z
New upstream version 2.4.17
- - - - -
24 changed files:
- NOTICE
- gradle.properties
- gradle/docs.gradle
- notices/NOTICE-BASE
- notices/NOTICE-BINZIP
- notices/NOTICE-GROOID
- notices/NOTICE-GROOIDJARJAR
- notices/NOTICE-JARJAR
- notices/NOTICE-SDK
- src/main/org/codehaus/groovy/ast/ConstructorNode.java
- src/main/org/codehaus/groovy/ast/MethodNode.java
- src/main/org/codehaus/groovy/classgen/AsmClassGenerator.java
- src/main/org/codehaus/groovy/tools/FileSystemCompiler.java
- src/main/org/codehaus/groovy/transform/ASTTestTransformation.groovy
- src/main/org/codehaus/groovy/vmplugin/v5/Java5.java
- src/spec/doc/core-metaprogramming.adoc
- src/spec/doc/style-guide.adoc
- src/test/groovy/bugs/Groovy8008Bug.java
- + src/test/groovy/bugs/Groovy9010Bug.groovy
- + src/test/groovy/bugs/groovy8953/Enum8953.java
- + src/test/groovy/bugs/groovy8953/SyntheticParameterAnnotationsBug.groovy
- subprojects/groovy-console/NOTICE
- subprojects/groovy-console/src/main/groovy/groovy/ui/Console.groovy
- subprojects/groovy-console/src/main/groovy/groovy/ui/ConsoleView.groovy
Changes:
=====================================
NOTICE
=====================================
@@ -1,5 +1,5 @@
Apache Groovy
-Copyright 2003-2018 The Apache Software Foundation
+Copyright 2003-2019 The Apache Software Foundation
This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).
=====================================
gradle.properties
=====================================
@@ -13,9 +13,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-groovyVersion = 2.4.16
+groovyVersion = 2.4.17
# bundle version format: major('.'minor('.'micro('.'qualifier)?)?)? (first 3 only digits)
-groovyBundleVersion = 2.4.16
+groovyBundleVersion = 2.4.17
gradle_version=2.14.1
=====================================
gradle/docs.gradle
=====================================
@@ -20,7 +20,7 @@ task doc(dependsOn: ['javadocAll', 'groovydocAll', 'docGDK']) {
if (JavaVersion.current().java7Compatible) {
dependsOn 'asciidocAll', 'assembleAsciidoc'
}
- ext.footer = 'Copyright © 2003-2018 The Apache Software Foundation. All rights reserved.'
+ ext.footer = 'Copyright © 2003-2019 The Apache Software Foundation. All rights reserved.'
ext.title = "Groovy ${groovyVersion}"
}
=====================================
notices/NOTICE-BASE
=====================================
@@ -1,5 +1,5 @@
Apache Groovy
-Copyright 2003-2018 The Apache Software Foundation
+Copyright 2003-2019 The Apache Software Foundation
This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).
=====================================
notices/NOTICE-BINZIP
=====================================
@@ -1,5 +1,5 @@
Apache Groovy
-Copyright 2003-2018 The Apache Software Foundation
+Copyright 2003-2019 The Apache Software Foundation
This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).
=====================================
notices/NOTICE-GROOID
=====================================
@@ -1,5 +1,5 @@
Apache Groovy
-Copyright 2003-2018 The Apache Software Foundation
+Copyright 2003-2019 The Apache Software Foundation
This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).
=====================================
notices/NOTICE-GROOIDJARJAR
=====================================
@@ -1,5 +1,5 @@
Apache Groovy
-Copyright 2003-2018 The Apache Software Foundation
+Copyright 2003-2019 The Apache Software Foundation
This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).
=====================================
notices/NOTICE-JARJAR
=====================================
@@ -1,5 +1,5 @@
Apache Groovy
-Copyright 2003-2018 The Apache Software Foundation
+Copyright 2003-2019 The Apache Software Foundation
This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).
=====================================
notices/NOTICE-SDK
=====================================
@@ -1,5 +1,5 @@
Apache Groovy
-Copyright 2003-2018 The Apache Software Foundation
+Copyright 2003-2019 The Apache Software Foundation
This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).
=====================================
src/main/org/codehaus/groovy/ast/ConstructorNode.java
=====================================
@@ -23,29 +23,19 @@ import org.codehaus.groovy.ast.expr.Expression;
import org.codehaus.groovy.ast.stmt.ExpressionStatement;
import org.codehaus.groovy.ast.stmt.Statement;
-
/**
* Represents a constructor declaration
- *
- * @author <a href="mailto:james at coredevelopers.net">James Strachan</a>
*/
public class ConstructorNode extends MethodNode {
-
+
public ConstructorNode(int modifiers, Statement code) {
this(modifiers, Parameter.EMPTY_ARRAY, ClassNode.EMPTY_ARRAY, code);
}
-
+
public ConstructorNode(int modifiers, Parameter[] parameters, ClassNode[] exceptions, Statement code) {
- super("<init>",modifiers,ClassHelper.VOID_TYPE,parameters,exceptions,code);
-
- // This variable scope is thrown out and replaced with a different one during semantic analysis.
- VariableScope scope = new VariableScope();
- for (int i = 0; i < parameters.length; i++) {
- scope.putDeclaredVariable(parameters[i]);
- }
- this.setVariableScope(scope);
+ super("<init>", modifiers, ClassHelper.VOID_TYPE, parameters, exceptions, code);
}
-
+
public boolean firstStatementIsSpecialConstructorCall() {
Statement code = getFirstStatement();
if (code == null || !(code instanceof ExpressionStatement)) return false;
=====================================
src/main/org/codehaus/groovy/ast/MethodNode.java
=====================================
@@ -57,8 +57,6 @@ public class MethodNode extends AnnotatedNode implements Opcodes {
this.modifiers = modifiers;
this.code = code;
setReturnType(returnType);
- VariableScope scope = new VariableScope();
- setVariableScope(scope);
setParameters(parameters);
this.hasDefault = false;
this.exceptions = exceptions;
=====================================
src/main/org/codehaus/groovy/classgen/AsmClassGenerator.java
=====================================
@@ -967,6 +967,7 @@ public class AsmClassGenerator extends ClassGenerator {
new ClassExpression(outer),
expression.getProperty()
);
+ pexp.getObjectExpression().setSourcePosition(objectExpression);
pexp.visit(controller.getAcg());
return;
}
=====================================
src/main/org/codehaus/groovy/tools/FileSystemCompiler.java
=====================================
@@ -84,7 +84,7 @@ public class FileSystemCompiler {
public static void displayVersion() {
String version = GroovySystem.getVersion();
System.err.println("Groovy compiler version " + version);
- System.err.println("Copyright 2003-2018 The Apache Software Foundation. http://groovy-lang.org/");
+ System.err.println("Copyright 2003-2019 The Apache Software Foundation. http://groovy-lang.org/");
System.err.println("");
}
=====================================
src/main/org/codehaus/groovy/transform/ASTTestTransformation.groovy
=====================================
@@ -84,7 +84,7 @@ class ASTTestTransformation extends AbstractASTTransformation implements Compila
for (int i = testClosure.lineNumber; i <= testClosure.lastLineNumber; i++) {
sb.append(source.source.getLine(i, new Janitor())).append('\n')
}
- def testSource = sb.substring(testClosure.columnNumber + 1, sb.length())
+ def testSource = sb.substring(testClosure.columnNumber, sb.length())
testSource = testSource.substring(0, testSource.lastIndexOf('}'))
CompilerConfiguration config = new CompilerConfiguration()
def customizer = new ImportCustomizer()
=====================================
src/main/org/codehaus/groovy/vmplugin/v5/Java5.java
=====================================
@@ -431,18 +431,20 @@ public class Java5 implements VMPlugin {
Annotation[][] annotations = constructor.getParameterAnnotations();
int diff = parameterCount - annotations.length;
if (diff > 0) {
- // May happen on JDK8 and below, but we only expect to have to
- // add a single element to the front of the array to account
- // for the synthetic outer reference
- if (diff > 1) {
+ // May happen on JDK8 and below. We add elements to the front of the array to account for the synthetic params:
+ // - for an inner class we expect one param to account for the synthetic outer reference
+ // - for an enum we expect two params to account for the synthetic name and ordinal
+ if ((!constructor.getDeclaringClass().isEnum() && diff > 1) || diff > 2) {
throw new GroovyBugError(
"Constructor parameter annotations length [" + annotations.length + "] " +
"does not match the parameter length: " + constructor
);
}
Annotation[][] adjusted = new Annotation[parameterCount][];
- adjusted[0] = new Annotation[0];
- System.arraycopy(annotations, 0, adjusted, 1, annotations.length);
+ for (int i = 0; i < diff; i++) {
+ adjusted[i] = new Annotation[0];
+ }
+ System.arraycopy(annotations, 0, adjusted, diff, annotations.length);
return adjusted;
}
return annotations;
=====================================
src/spec/doc/core-metaprogramming.adoc
=====================================
@@ -97,7 +97,7 @@ include::{projectdir}/src/spec/test/metaprogramming/GroovyObjectTest.groovy[tags
==== get/setMetaClass
-You can a access an object's `metaClass` or set your own `MetaClass` implementation for changing the default interception mechanism. For example, you can write your own implementation of the `MetaClass` interface and assign it to objects in order to change the interception mechanism:
+You can access an object's `metaClass` or set your own `MetaClass` implementation for changing the default interception mechanism. For example, you can write your own implementation of the `MetaClass` interface and assign it to objects in order to change the interception mechanism:
[source,groovy]
----
=====================================
src/spec/doc/style-guide.adoc
=====================================
@@ -477,7 +477,7 @@ These methods add a functional flavor to the programming language and help worki
Lots of new methods are applied to various types, through decoration, thanks to the dynamic nature of the language.
You can find lots of very useful methods on String, Files, Streams, Collections, and much more:
-http://beta.groovy-lang.org/gdk.html
+http://groovy-lang.org/gdk.html
== The power of switch
=====================================
src/test/groovy/bugs/Groovy8008Bug.java
=====================================
@@ -47,7 +47,7 @@ public class Groovy8008Bug extends TestCase {
Class<Inner> innerClass = Inner.class;
Constructor<Inner> ctor = innerClass.getDeclaredConstructor(Groovy8008Bug.class, String.class, Date.class, String.class);
- assertEquals(4, ctor.getParameterTypes().length); //Groovy8008Bug,String,Date,String
+ assertEquals(4, ctor.getParameterTypes().length);
// JDK 9 and above correctly report 4
// assertEquals(3, ctor.getParameterAnnotations().length); //[],[@Anno1, at Anno2],[@Anno2]
@@ -58,24 +58,57 @@ public class Groovy8008Bug extends TestCase {
assertEquals(1, ctors.size());
Parameter[] params = ctors.get(0).getParameters();
+ checkOuterRef(params[0], Groovy8008Bug.class);
+ checkStringWithNoAnnos(params[1]);
+ checkDateWithTwoAnnos(params[2]);
+ checkStringWithOneAnno(params[3]);
- assertEquals(Groovy8008Bug.class.getName(), params[0].getType().getName());
- assertEquals(0, params[0].getAnnotations().size());
+ // do the same again for an inner inner class
+ Class<Inner.InnerInner> innerInnerClass = Inner.InnerInner.class;
+ Constructor<Inner.InnerInner> innerCtor = innerInnerClass.getDeclaredConstructor(Groovy8008Bug.Inner.class, String.class, Date.class, String.class);
+ assertEquals(4, innerCtor.getParameterTypes().length);
- assertEquals(String.class.getName(), params[1].getType().getName());
- assertEquals(0, params[1].getAnnotations().size());
+ cn = new ClassNode(innerInnerClass);
- assertEquals(Date.class.getName(), params[2].getType().getName());
- assertEquals(2, params[2].getAnnotations().size());
- assertEquals(TestAnno1.class.getName(), params[2].getAnnotations().get(0).getClassNode().getName());
- assertEquals(TestAnno2.class.getName(), params[2].getAnnotations().get(1).getClassNode().getName());
+ // trigger the call to VMPlugin#configureClassNode(CompileUnit,ClassNode)
+ ctors = cn.getDeclaredConstructors();
+ assertEquals(1, ctors.size());
+
+ params = ctors.get(0).getParameters();
+ checkOuterRef(params[0], Groovy8008Bug.Inner.class);
+ checkStringWithNoAnnos(params[1]);
+ checkDateWithTwoAnnos(params[2]);
+ checkStringWithOneAnno(params[3]);
+ }
+
+ private void checkOuterRef(Parameter param, Class outerClass) {
+ assertEquals(outerClass.getName(), param.getType().getName());
+ assertEquals(0, param.getAnnotations().size());
+ }
- assertEquals(String.class.getName(), params[3].getType().getName());
- assertEquals(1, params[3].getAnnotations().size());
- assertEquals(TestAnno2.class.getName(), params[3].getAnnotations().get(0).getClassNode().getName());
+ private void checkStringWithOneAnno(Parameter param) {
+ assertEquals(String.class.getName(), param.getType().getName());
+ assertEquals(1, param.getAnnotations().size());
+ assertEquals(TestAnno2.class.getName(), param.getAnnotations().get(0).getClassNode().getName());
+ }
+
+ private void checkStringWithNoAnnos(Parameter param) {
+ assertEquals(String.class.getName(), param.getType().getName());
+ assertEquals(0, param.getAnnotations().size());
+ }
+
+ private void checkDateWithTwoAnnos(Parameter param2) {
+ assertEquals(Date.class.getName(), param2.getType().getName());
+ assertEquals(2, param2.getAnnotations().size());
+ assertEquals(TestAnno1.class.getName(), param2.getAnnotations().get(0).getClassNode().getName());
+ assertEquals(TestAnno2.class.getName(), param2.getAnnotations().get(1).getClassNode().getName());
}
private class Inner {
private Inner(String arg1, @TestAnno1 @TestAnno2 Date arg2, @TestAnno2 String arg3) { }
+
+ private class InnerInner {
+ private InnerInner(String arg1, @TestAnno1 @TestAnno2 Date arg2, @TestAnno2 String arg3) { }
+ }
}
}
=====================================
src/test/groovy/bugs/Groovy9010Bug.groovy
=====================================
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package groovy.bugs
+
+import gls.CompilableTestSupport
+
+class Groovy9010Bug extends CompilableTestSupport {
+ void testASTTestWithNoSpacesInClosure() {
+ shouldCompile '''
+ @groovy.transform.ASTTest({assert 1==1})
+ def x
+ '''
+ }
+}
=====================================
src/test/groovy/bugs/groovy8953/Enum8953.java
=====================================
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package groovy.bugs.groovy8953;
+
+public enum Enum8953 {
+ A("value");
+ public String value;
+
+ Enum8953(@Deprecated final String value) {
+ this.value = value;
+ }
+}
=====================================
src/test/groovy/bugs/groovy8953/SyntheticParameterAnnotationsBug.groovy
=====================================
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package groovy.bugs.groovy8953
+
+class SyntheticParameterAnnotationsBug extends GroovyTestCase {
+ void testEnumConstructorWithSyntheticParamUsageWithAsmResolvingDisabled() {
+ assertScript '''
+ import org.codehaus.groovy.control.CompilerConfiguration
+
+ def script = "assert groovy.bugs.groovy8953.Enum8953.A.value == 'value'"
+ def config = new CompilerConfiguration()
+ new GroovyShell(config).evaluate(script, "bug8953_dummyName.groovy")
+ '''
+ }
+}
=====================================
subprojects/groovy-console/NOTICE
=====================================
@@ -1,5 +1,5 @@
Apache Groovy
-Copyright 2003-2018 The Apache Software Foundation
+Copyright 2003-2019 The Apache Software Foundation
This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).
=====================================
subprojects/groovy-console/src/main/groovy/groovy/ui/Console.groovy
=====================================
@@ -1269,7 +1269,7 @@ options:
}
void selectAll(EventObject evt = null) {
- invokeTextAction(evt, { source -> source.selectAll() })
+ invokeTextAction(evt, { source -> source.selectAll() }, copyFromComponent ?: inputArea)
}
void setRowNumAndColNum() {
=====================================
subprojects/groovy-console/src/main/groovy/groovy/ui/ConsoleView.groovy
=====================================
@@ -68,6 +68,24 @@ container(consoleFrame) {
build(statusBarClass)
}
+inputEditor.textEditor.componentPopupMenu = popupMenu {
+ menuItem(cutAction)
+ menuItem(copyAction)
+ menuItem(pasteAction)
+ menuItem(selectAllAction)
+ separator()
+ menuItem(undoAction)
+ menuItem(redoAction)
+ separator()
+ menuItem(runAction)
+ menuItem(runSelectionAction)
+}
+
+outputArea.componentPopupMenu = popupMenu {
+ menuItem(copyAction)
+ menuItem(selectAllAction)
+ menuItem(clearOutputAction)
+}
controller.promptStyle = promptStyle
controller.commandStyle = commandStyle
View it on GitLab: https://salsa.debian.org/java-team/groovy/commit/55bd2a07b6a8bf1c81258abfa8a0b1f29ba9e8e3
--
View it on GitLab: https://salsa.debian.org/java-team/groovy/commit/55bd2a07b6a8bf1c81258abfa8a0b1f29ba9e8e3
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-java-commits/attachments/20190715/64f79b36/attachment.html>
More information about the pkg-java-commits
mailing list