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 2022/07/02 18:54:21 UTC

[groovy] 02/02: Reserve `isAnnotationCompatible` for binary compatibility

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

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

commit b594a140755200bfff3f145185ac54a22db386f1
Author: Daniel Sun <su...@apache.org>
AuthorDate: Sun Jul 3 02:48:18 2022 +0800

    Reserve `isAnnotationCompatible` for binary compatibility
---
 .../java/org/codehaus/groovy/classgen/ExtendedVerifier.java   | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/src/main/java/org/codehaus/groovy/classgen/ExtendedVerifier.java b/src/main/java/org/codehaus/groovy/classgen/ExtendedVerifier.java
index ddf44415c2..2b52ac267b 100644
--- a/src/main/java/org/codehaus/groovy/classgen/ExtendedVerifier.java
+++ b/src/main/java/org/codehaus/groovy/classgen/ExtendedVerifier.java
@@ -39,6 +39,7 @@ import org.codehaus.groovy.ast.expr.VariableExpression;
 import org.codehaus.groovy.ast.stmt.ReturnStatement;
 import org.codehaus.groovy.ast.stmt.Statement;
 import org.codehaus.groovy.control.AnnotationConstantsVisitor;
+import org.codehaus.groovy.control.CompilerConfiguration;
 import org.codehaus.groovy.control.ErrorCollector;
 import org.codehaus.groovy.control.SourceUnit;
 import org.objectweb.asm.Opcodes;
@@ -458,4 +459,14 @@ public class ExtendedVerifier extends ClassCodeVisitorSupport {
         }
         return null;
     }
+
+    /**
+     * Check if the current runtime allows Annotation usage.
+     *
+     * @return true if running on a 1.5+ runtime
+     */
+    @Deprecated
+    protected boolean isAnnotationCompatible() {
+        return CompilerConfiguration.isPostJDK5(this.source.getConfiguration().getTargetBytecode());
+    }
 }