8071588: The spec for javax.script.ScriptEngineFactory.getProgram() should specify NPEs thrown

Reviewed-by: alanb, hannesw
This commit is contained in:
Athijegannathan Sundararajan 2016-10-19 13:27:20 +05:30
parent 5f4ad59aee
commit 093753dee1

View File

@ -129,10 +129,11 @@ public final class NashornScriptEngineFactory implements ScriptEngineFactory {
@Override
public String getProgram(final String... statements) {
Objects.requireNonNull(statements);
final StringBuilder sb = new StringBuilder();
for (final String statement : statements) {
sb.append(statement).append(';');
sb.append(Objects.requireNonNull(statement)).append(';');
}
return sb.toString();