You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by su...@apache.org on 2019/08/23 09:22:51 UTC

[groovy] branch GROOVY_2_5_X updated (cf3595e -> 97783c7)

This is an automated email from the ASF dual-hosted git repository.

sunlan pushed a change to branch GROOVY_2_5_X
in repository https://gitbox.apache.org/repos/asf/groovy.git.


    from cf3595e  GROOVY-9215: Incorrect compile time access error is raised when using… (#992)
     new 6875965  Try to fix the failing build
     new 97783c7  GROOVY-9226: Calling super.toString() with @TypeChecked or @CompileStatic will throw java.lang.StackOverflowError

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../groovy/transform/ASTTransformationVisitor.java |  7 +++--
 .../{Groovy9063Bug.groovy => Groovy9226Bug.groovy} | 31 +++++++++++-----------
 2 files changed, 19 insertions(+), 19 deletions(-)
 copy src/test/groovy/bugs/{Groovy9063Bug.groovy => Groovy9226Bug.groovy} (67%)


[groovy] 01/02: Try to fix the failing build

Posted by su...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

sunlan pushed a commit to branch GROOVY_2_5_X
in repository https://gitbox.apache.org/repos/asf/groovy.git

commit 687596522d22eb5bf086c5046e6e5a597b93c61a
Author: Daniel Sun <su...@apache.org>
AuthorDate: Fri Aug 23 17:21:47 2019 +0800

    Try to fix the failing build
---
 .../org/codehaus/groovy/transform/ASTTransformationVisitor.java    | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/main/java/org/codehaus/groovy/transform/ASTTransformationVisitor.java b/src/main/java/org/codehaus/groovy/transform/ASTTransformationVisitor.java
index c356811..950ca9d 100644
--- a/src/main/java/org/codehaus/groovy/transform/ASTTransformationVisitor.java
+++ b/src/main/java/org/codehaus/groovy/transform/ASTTransformationVisitor.java
@@ -19,8 +19,6 @@
 package org.codehaus.groovy.transform;
 
 import groovy.lang.GroovyClassLoader;
-import groovy.lang.Tuple;
-import groovy.lang.Tuple3;
 import groovy.transform.CompilationUnitAware;
 import org.codehaus.groovy.ast.ASTNode;
 import org.codehaus.groovy.ast.AnnotatedNode;
@@ -46,6 +44,7 @@ import java.lang.reflect.InvocationTargetException;
 import java.net.URISyntaxException;
 import java.net.URL;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collections;
 import java.util.Enumeration;
 import java.util.HashMap;
@@ -166,8 +165,8 @@ public final class ASTTransformationVisitor extends ClassCodeVisitorSupport {
         }
     }
 
-    private static final Tuple3<String, String, String> COMPILEDYNAMIC_AND_COMPILESTATIC_AND_TYPECHECKED =
-            Tuple.tuple("groovy.transform.CompileDynamic", "groovy.transform.CompileStatic", "groovy.transform.TypeChecked");
+    private static final List<String> COMPILEDYNAMIC_AND_COMPILESTATIC_AND_TYPECHECKED =
+            Arrays.asList("groovy.transform.CompileDynamic", "groovy.transform.CompileStatic", "groovy.transform.TypeChecked");
 
     // GROOVY-9215
     // `StaticTypeCheckingVisitor` visits multi-times because `node` has duplicated `CompileStatic` and `TypeChecked`


[groovy] 02/02: GROOVY-9226: Calling super.toString() with @TypeChecked or @CompileStatic will throw java.lang.StackOverflowError

Posted by su...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

sunlan pushed a commit to branch GROOVY_2_5_X
in repository https://gitbox.apache.org/repos/asf/groovy.git

commit 97783c783c87cdf8af9e18359c904979532eb089
Author: Daniel Sun <su...@apache.org>
AuthorDate: Thu Aug 15 15:18:43 2019 +0800

    GROOVY-9226: Calling super.toString() with @TypeChecked or @CompileStatic will throw java.lang.StackOverflowError
    
    (cherry picked from commit 007877d9b5414ddd08ac34444a30c9712bf5754c)
---
 src/test/groovy/bugs/Groovy9226Bug.groovy | 43 +++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)

diff --git a/src/test/groovy/bugs/Groovy9226Bug.groovy b/src/test/groovy/bugs/Groovy9226Bug.groovy
new file mode 100644
index 0000000..30fd05d
--- /dev/null
+++ b/src/test/groovy/bugs/Groovy9226Bug.groovy
@@ -0,0 +1,43 @@
+/*
+ *  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
+
+class Groovy9226Bug extends GroovyTestCase {
+    void testDuplicatedAnnotations5() {
+        assertScript '''
+            import groovy.transform.CompileStatic
+            import groovy.transform.TypeChecked
+            
+            @CompileStatic
+            class Super {
+              String toString() { 'Super' }
+            }
+            
+            @TypeChecked
+            @CompileStatic
+            class Child extends Super {
+              String toString() { 'Child extends ' + super.toString() }
+            }
+            
+            assert new Child().toString()
+        '''
+    }
+
+}