Repository navigation
Disable the JUEL script engine lang:import function by default and allow configuring the script output writer - #4318
Open
filiphr wants to merge 1 commit into
Conversation
…low configuring the script output writer * The lang:import function in the JUEL script engine is no longer registered by default, it can be enabled through JuelScriptEngineFactory#setImportFunctionEnabled * The JUEL out:print function now writes to the writer of the script context instead of always using System.out * Add JSR223FlowableScriptEngine#setScriptOutputWriter to configure the writer used for script output (e.g. to discard it or keep it in memory)
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related to #4314
The JUEL script engine registered the
lang:importfunction whenever there was noSecurityManager, which is always the case on current JVMs. That function loads any class by name and exposes all its public static methods to the script.lang:importis now only registered when it is explicitly enabled on the factory. Anyone relying on it can register a configured factory, which takes precedence over the one discovered throughMETA-INF/services:The second part makes script output configurable. The JUEL
out:printfunction used to always write toSystem.out. It now writes to the writer of the JSR-223ScriptContext, like Groovy'sprintlnand JavaScript'sprintalready do. EL functions have to be static methods, so the current script context is kept in aThreadLocalduring evaluation.JSR223FlowableScriptEngine#setScriptOutputWritersets the writer used for the output of all scripts, e.g.Writer.nullWriter()to discard it or aStringWriterto keep it in memory. When it is not set (the default), scripts are evaluated exactly as before.The same
lang:importandout:printchanges are applied to the flowable5 compatibility engine.