The spec for the methods
http://docs.oracle.com/javase/8/docs/api/javax/script/ScriptEngine.html#put-java.lang.String-java.lang.Object-
http://docs.oracle.com/javase/8/docs/api/javax/script/ScriptEngine.html#get-java.lang.String-
says:
"Throws:
NullPointerException - if key is null.
IllegalArgumentException - if key is empty."
However the following code executed on Oracle's JDK.
new ScriptEngineManager().getEngineFactories()
.stream()
.map(ScriptEngineFactory::getScriptEngine)
.forEach(e -> {
e.get("");
e.get(null);
e.put("", "a");
e.put(null, "a");
});
results in no exceptions thrown which doesn't conform to the current spec and the corresponding JCK9(b05) tests will fail on JDK9:
api/javax_script/ScriptEngineFactory/index.html#GetParameter[get_keyIsEmpty_IAE]
api/javax_script/ScriptEngineFactory/index.html#GetParameter[get_keyIsNull_NPE]
api/javax_script/ScriptEngineFactory/index.html#GetParameter[put_keyIsEmpty_IAE]
api/javax_script/ScriptEngineFactory/index.html#GetParameter[put_keyIsNull_NPE]