Skip to content

Commit

Permalink
Fix for #1167: disable preview features for expression evaluation
Browse files Browse the repository at this point in the history
  • Loading branch information
eric-milles committed Oct 7, 2020
1 parent 116dc80 commit 07044bb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2334,6 +2334,9 @@ public static Object evaluateExpression(Expression expr, CompilerConfiguration c
ReturnStatement code = new ReturnStatement(expr);
addGeneratedMethod(node, "eval", Opcodes.ACC_PUBLIC + Opcodes.ACC_STATIC, OBJECT_TYPE, Parameter.EMPTY_ARRAY, ClassNode.EMPTY_ARRAY, code);
CompilerConfiguration copyConf = new CompilerConfiguration(config);
// GRECLIPSE add
copyConf.setPreviewFeatures(false);
// GRECLIPSE end
CompilationUnit cu = new CompilationUnit(copyConf);
cu.addClassNode(node);
cu.compile(Phases.CLASS_GENERATION);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2160,6 +2160,9 @@ public static Object evaluateExpression(final Expression expr, final CompilerCon
ReturnStatement code = new ReturnStatement(expr);
addGeneratedMethod(node, "eval", Opcodes.ACC_PUBLIC + Opcodes.ACC_STATIC, OBJECT_TYPE, Parameter.EMPTY_ARRAY, ClassNode.EMPTY_ARRAY, code);
CompilerConfiguration copyConf = new CompilerConfiguration(config);
// GRECLIPSE add
copyConf.setPreviewFeatures(false);
// GRECLIPSE end
CompilationUnit cu = new CompilationUnit(copyConf);
cu.addClassNode(node);
cu.compile(Phases.CLASS_GENERATION);
Expand Down

0 comments on commit 07044bb

Please sign in to comment.