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 2019/04/25 10:15:53 UTC
[groovy] branch master updated: GROOVY-9073: added compiler option
to enable preview features - simplify case where preview wouldn't be
allowed by JDK anyway
This is an automated email from the ASF dual-hosted git repository.
paulk 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 76fe6fb GROOVY-9073: added compiler option to enable preview features - simplify case where preview wouldn't be allowed by JDK anyway
76fe6fb is described below
commit 76fe6fbd1948571332dc98363f73a934a0945ab3
Author: Paul King <pa...@asert.com.au>
AuthorDate: Thu Apr 25 20:15:42 2019 +1000
GROOVY-9073: added compiler option to enable preview features - simplify case where preview wouldn't be allowed by JDK anyway
---
src/main/java/org/codehaus/groovy/classgen/asm/WriterController.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/main/java/org/codehaus/groovy/classgen/asm/WriterController.java b/src/main/java/org/codehaus/groovy/classgen/asm/WriterController.java
index 1747f8b..28e41ad 100644
--- a/src/main/java/org/codehaus/groovy/classgen/asm/WriterController.java
+++ b/src/main/java/org/codehaus/groovy/classgen/asm/WriterController.java
@@ -149,11 +149,12 @@ public class WriterController {
}
return new LoggableClassVisitor(cv);
}
+
private static int chooseBytecodeVersion(final boolean invokedynamic, final boolean previewFeatures, final String targetBytecode) {
Integer bytecodeVersion = CompilerConfiguration.JDK_TO_BYTECODE_VERSION_MAP.get(targetBytecode);
if (invokedynamic && bytecodeVersion < Opcodes.V1_8) {
- return previewFeatures ? Opcodes.V1_8 | Opcodes.V_PREVIEW : Opcodes.V1_8;
+ return Opcodes.V1_8;
} else {
if (null != bytecodeVersion) {
return previewFeatures ? bytecodeVersion | Opcodes.V_PREVIEW : bytecodeVersion;