You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by pa...@apache.org on 2020/07/24 07:09:14 UTC

[groovy] branch GROOVY_2_5_X updated (22acefc -> 69d2bb1)

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

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


    from 22acefc  GROOVY-9637: prefactor existing utility
     new 1407ccd  GROOVY-9654: should not consider bridge methods when determining whether an overridden method annotated with @Override is valid (compiler tweak)
     new 69d2bb1  GROOVY-9654: should not consider bridge methods when determining whether an overridden method annotated with @Override is valid (test)

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:
 .../java/org/codehaus/groovy/classgen/Verifier.java   |  1 +
 .../src/test/groovy/groovy/bugs/Groovy9654.groovy     | 19 ++++++++++---------
 2 files changed, 11 insertions(+), 9 deletions(-)
 copy src/test/groovy/bugs/Groovy4614Bug.groovy => subprojects/groovy-console/src/test/groovy/groovy/bugs/Groovy9654.groovy (73%)


[groovy] 01/02: GROOVY-9654: should not consider bridge methods when determining whether an overridden method annotated with @Override is valid (compiler tweak)

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

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

commit 1407ccdffe40c4ac2b735854bbc0ff3f35ef010f
Author: Paul King <pa...@asert.com.au>
AuthorDate: Fri Jul 24 17:07:55 2020 +1000

    GROOVY-9654: should not consider bridge methods when determining whether an overridden method annotated with @Override is valid (compiler tweak)
---
 src/main/java/org/codehaus/groovy/classgen/Verifier.java | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/main/java/org/codehaus/groovy/classgen/Verifier.java b/src/main/java/org/codehaus/groovy/classgen/Verifier.java
index 10697b6..4a7e627 100644
--- a/src/main/java/org/codehaus/groovy/classgen/Verifier.java
+++ b/src/main/java/org/codehaus/groovy/classgen/Verifier.java
@@ -1345,6 +1345,7 @@ public class Verifier implements GroovyClassVisitor, Opcodes {
         // method name
         if (!oldMethod.getName().equals(overridingMethod.getName())) return null;
         if ((overridingMethod.getModifiers() & ACC_BRIDGE) != 0) return null;
+        if ((oldMethod.getModifiers() & ACC_BRIDGE) != 0) return null;
         if (oldMethod.isPrivate()) return null;
 
         // parameters


[groovy] 02/02: GROOVY-9654: should not consider bridge methods when determining whether an overridden method annotated with @Override is valid (test)

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

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

commit 69d2bb14831b7f6777405161122886d37a4ba0a0
Author: Paul King <pa...@asert.com.au>
AuthorDate: Fri Jul 24 17:09:02 2020 +1000

    GROOVY-9654: should not consider bridge methods when determining whether an overridden method annotated with @Override is valid (test)
---
 .../src/test/groovy/groovy/bugs/Groovy9654.groovy  | 38 ++++++++++++++++++++++
 1 file changed, 38 insertions(+)

diff --git a/subprojects/groovy-console/src/test/groovy/groovy/bugs/Groovy9654.groovy b/subprojects/groovy-console/src/test/groovy/groovy/bugs/Groovy9654.groovy
new file mode 100644
index 0000000..ceeb44f
--- /dev/null
+++ b/subprojects/groovy-console/src/test/groovy/groovy/bugs/Groovy9654.groovy
@@ -0,0 +1,38 @@
+/*
+ *  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
+
+final class Groovy9654 extends CompilableTestSupport {
+
+    void testOverrideAnnotationOnClassWithBridgeMethod() {
+        shouldCompile """
+            import groovy.ui.Console
+
+            import java.util.EventObject
+
+            class ConsoleExt extends Console {
+                @Override
+                boolean exit(EventObject evt) {
+                }
+            }
+        """
+    }
+}