Skip to content

Commit

Permalink
added additional MVEL static settings, so they are in each MVEL invoc…
Browse files Browse the repository at this point in the history
…ation point
  • Loading branch information
mdproctor committed Aug 22, 2011
1 parent 442246d commit d1cd521
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -834,6 +834,9 @@ private void setInputs( RuleBuildContext context,
pctx.addInput( "empty",
boolean.class ); // overrides the mvel empty label
MVEL.COMPILER_OPT_ALLOW_NAKED_METH_CALL = true;
MVEL.COMPILER_OPT_ALLOW_OVERRIDE_ALL_PROPHANDLING = true;
MVEL.COMPILER_OPT_ALLOW_RESOLVE_INNERCLASSES_WITH_DOTNOTATION = true;
MVEL.COMPILER_OPT_SUPPORT_JAVA_STYLE_CLASS_LITERALS = true;
MVEL.analysisCompile( expr,
pctx );

Expand Down Expand Up @@ -1176,7 +1179,11 @@ private LiteralRestriction buildLiteralRestriction( final RuleBuildContext conte
ValueType vtype = extractor.getValueType();
try {
String value = literalRestrictionDescr.getText().trim();

MVEL.COMPILER_OPT_ALLOW_NAKED_METH_CALL = true;
MVEL.COMPILER_OPT_ALLOW_OVERRIDE_ALL_PROPHANDLING = true;
MVEL.COMPILER_OPT_ALLOW_RESOLVE_INNERCLASSES_WITH_DOTNOTATION = true;
MVEL.COMPILER_OPT_SUPPORT_JAVA_STYLE_CLASS_LITERALS = true;

MVELDialectRuntimeData data = (MVELDialectRuntimeData) context.getPkg().getDialectRuntimeRegistry().getDialectData( "mvel" );
ParserConfiguration pconf = data.getParserConfiguration();
ParserContext pctx = new ParserContext( pconf );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ public MVELAnalysisResult analyzeExpression(final PackageBuildContext context,
MVELAnalysisResult result = null;
if ( expr.trim().length() > 0 ) {
MVEL.COMPILER_OPT_ALLOW_NAKED_METH_CALL = true;
MVEL.COMPILER_OPT_ALLOW_OVERRIDE_ALL_PROPHANDLING = true;
MVEL.COMPILER_OPT_ALLOW_RESOLVE_INNERCLASSES_WITH_DOTNOTATION = true;
MVEL.COMPILER_OPT_SUPPORT_JAVA_STYLE_CLASS_LITERALS = true;

MVELDialect dialect = (MVELDialect) context.getDialect( "mvel" );

MVELDialectRuntimeData data = ( MVELDialectRuntimeData) context.getPkg().getDialectRuntimeRegistry().getDialectData( "mvel" );
Expand Down

0 comments on commit d1cd521

Please sign in to comment.