[automation] Use Java 17 features (#15484)

* [automation] Code optimization for Java17: instanceof matching and multiline strings

Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>

* [automation] Make use of Java17 features

Use Map/Set/List.of instead of Collections.

Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>

* review comment

Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>

---------

Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
This commit is contained in:
Holger Friedrich
2023-08-23 17:27:40 +02:00
committed by GitHub
parent 626c6bde4a
commit 7b90fbe162
10 changed files with 35 additions and 31 deletions

View File

@@ -123,8 +123,8 @@ public class JRubyScriptEngineFactory extends AbstractScriptEngineFactory {
importClassesToRuby(scriptEngine, partitionedMap.getOrDefault(true, new HashMap<>()));
Object scriptExtension = scopeValues.get("scriptExtension");
if (scriptExtension instanceof ScriptExtensionManagerWrapper && configuration.enableDependencyTracking()) {
ScriptExtensionManagerWrapper wrapper = (ScriptExtensionManagerWrapper) scriptExtension;
if (scriptExtension instanceof ScriptExtensionManagerWrapper wrapper
&& configuration.enableDependencyTracking()) {
// we inject like this instead of using the script context, because
// this is executed _before_ the dependency tracker is added to the script
// context.