Skip to content

Commit

Permalink
Remove removeUnsupportedNashornArgs
Browse files Browse the repository at this point in the history
Signed-off-by: Wouter Born <[email protected]>
  • Loading branch information
wborn committed Dec 19, 2022
1 parent b7194fc commit 2b2da41
Showing 1 changed file with 0 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,24 +38,12 @@
@NonNullByDefault
public class NashornScriptEngineFactory extends AbstractScriptEngineFactory {

private static final String NASHORN_ARGS = "nashorn.args";

private final org.openjdk.nashorn.api.scripting.NashornScriptEngineFactory factory = new org.openjdk.nashorn.api.scripting.NashornScriptEngineFactory();

private final List<String> scriptTypes = (List<String>) Stream.of(factory.getExtensions(), factory.getMimeTypes())
.flatMap(List::stream) //
.collect(Collectors.toUnmodifiableList());

public NashornScriptEngineFactory() {
removeUnsupportedNashornArgs();
}

private void removeUnsupportedNashornArgs() {
String property = System.getProperty(NASHORN_ARGS, "");
property = property.replaceAll("--no-deprecation-warning", "").trim();
System.setProperty(NASHORN_ARGS, property);
}

@Override
public List<String> getScriptTypes() {
return scriptTypes;
Expand Down

0 comments on commit 2b2da41

Please sign in to comment.