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

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


The following commit(s) were added to refs/heads/master by this push:
     new 5288ee8  Trivial tweak: remove outdated check for annotation support
5288ee8 is described below

commit 5288ee88d0ad06504ea83068b2d32805df728170
Author: Daniel Sun <[email protected]>
AuthorDate: Sat Oct 16 22:55:56 2021 +0800

    Trivial tweak: remove outdated check for annotation support
---
 src/main/java/org/codehaus/groovy/classgen/ExtendedVerifier.java | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/src/main/java/org/codehaus/groovy/classgen/ExtendedVerifier.java 
b/src/main/java/org/codehaus/groovy/classgen/ExtendedVerifier.java
index ea1ec4e..00bbf4b 100644
--- a/src/main/java/org/codehaus/groovy/classgen/ExtendedVerifier.java
+++ b/src/main/java/org/codehaus/groovy/classgen/ExtendedVerifier.java
@@ -65,10 +65,10 @@ import static 
org.codehaus.groovy.ast.AnnotationNode.PARAMETER_TARGET;
 import static org.codehaus.groovy.ast.AnnotationNode.TYPE_PARAMETER_TARGET;
 import static org.codehaus.groovy.ast.AnnotationNode.TYPE_TARGET;
 import static org.codehaus.groovy.ast.AnnotationNode.TYPE_USE_TARGET;
+import static org.codehaus.groovy.ast.ClassHelper.isObjectType;
 import static 
org.codehaus.groovy.ast.tools.GenericsUtils.correctToGenericsSpec;
 import static 
org.codehaus.groovy.ast.tools.GenericsUtils.correctToGenericsSpecRecurse;
 import static org.codehaus.groovy.ast.tools.GenericsUtils.createGenericsSpec;
-import static org.codehaus.groovy.ast.ClassHelper.isObjectType;
 import static 
org.codehaus.groovy.transform.stc.StaticTypeCheckingSupport.evaluateExpression;
 
 /**
@@ -255,10 +255,6 @@ public class ExtendedVerifier extends 
ClassCodeVisitorSupport {
             return;
         }
         this.currentClass.setAnnotated(true);
-        if (!isAnnotationCompatible()) {
-            addError("Annotations are not supported in the current runtime. " 
+ JVM_ERROR_MESSAGE, node);
-            return;
-        }
         Map<String, List<AnnotationNode>> nonSourceAnnotations = new 
LinkedHashMap<>();
         for (AnnotationNode unvisited : annotations) {
             AnnotationNode visited;
@@ -458,6 +454,7 @@ public class ExtendedVerifier extends 
ClassCodeVisitorSupport {
      *
      * @return true if running on a 1.5+ runtime
      */
+    @Deprecated
     protected boolean isAnnotationCompatible() {
         return 
CompilerConfiguration.isPostJDK5(this.source.getConfiguration().getTargetBytecode());
     }

Reply via email to