-
Bug
-
Resolution: Fixed
-
P2
-
9
-
b142
-
Verified
The spec
http://docs.oracle.com/javase/8/docs/api/javax/script/ScriptEngineFactory.html#getProgram-java.lang.String...-
doesn't say anything about how null args are treated. However at least Nashorn impl throws NPEs. The spec deserves to be clarified regarding expected behavior.
The following lines
new ScriptEngineManager().getEngineFactories().forEach(f -> f.getProgram(null, null));
new ScriptEngineManager().getEngineFactories().forEach(f -> f.getProgram((String[])null));
when run on OracleJDK would cause NPEs:
Exception in thread "main" java.lang.NullPointerException
at jdk.nashorn.api.scripting.NashornScriptEngineFactory.getProgram(NashornScriptEngineFactory.java:131)
The following JCK9 tests will fail due to this issue:
api/javax_script/ScriptEngineFactory/index.html#GetProgram[test_nullArrayPassed]
api/javax_script/ScriptEngineFactory/index.html#GetProgram[test_nullArrayOfStatements]
http://docs.oracle.com/javase/8/docs/api/javax/script/ScriptEngineFactory.html#getProgram-java.lang.String...-
doesn't say anything about how null args are treated. However at least Nashorn impl throws NPEs. The spec deserves to be clarified regarding expected behavior.
The following lines
new ScriptEngineManager().getEngineFactories().forEach(f -> f.getProgram(null, null));
new ScriptEngineManager().getEngineFactories().forEach(f -> f.getProgram((String[])null));
when run on OracleJDK would cause NPEs:
Exception in thread "main" java.lang.NullPointerException
at jdk.nashorn.api.scripting.NashornScriptEngineFactory.getProgram(NashornScriptEngineFactory.java:131)
The following JCK9 tests will fail due to this issue:
api/javax_script/ScriptEngineFactory/index.html#GetProgram[test_nullArrayPassed]
api/javax_script/ScriptEngineFactory/index.html#GetProgram[test_nullArrayOfStatements]