-
Bug
-
Resolution: Fixed
-
P3
-
9
-
b51
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8084491 | emb-9 | Sundararajan Athijegannathan | P3 | Resolved | Fixed | team |
The spec
http://docs.oracle.com/javase/8/docs/api/javax/script/ScriptEngineFactory.html#getParameter-java.lang.String-
says:
"Returns null if no value is assigned to the key."
and doesn't mention any NPEs.
However the following line executed on Oracle's JDK.
new ScriptEngineManager().getEngineFactories().forEach(f -> f.getParameter(null));
will throw
java.lang.NullPointerException
at jdk.nashorn.api.scripting.NashornScriptEngineFactory.getParameter(NashornScriptEngineFactory.java:107)
which doesn't perfectly conform to the current spec and the corresponding JCK9(b05) test will fail on JDK9:
api/javax_script/ScriptEngineFactory/index.html#GetParameter[nullKey]
The specification or the Nashorn implementation needs to be corrected.
http://docs.oracle.com/javase/8/docs/api/javax/script/ScriptEngineFactory.html#getParameter-java.lang.String-
says:
"Returns null if no value is assigned to the key."
and doesn't mention any NPEs.
However the following line executed on Oracle's JDK.
new ScriptEngineManager().getEngineFactories().forEach(f -> f.getParameter(null));
will throw
java.lang.NullPointerException
at jdk.nashorn.api.scripting.NashornScriptEngineFactory.getParameter(NashornScriptEngineFactory.java:107)
which doesn't perfectly conform to the current spec and the corresponding JCK9(b05) test will fail on JDK9:
api/javax_script/ScriptEngineFactory/index.html#GetParameter[nullKey]
The specification or the Nashorn implementation needs to be corrected.
- backported by
-
JDK-8084491 ScriptEngineFactory.getParameter() should specify NPE for a null key
-
- Resolved
-