8071588: The spec for javax.script.ScriptEngineFactory.getProgram() should specify NPEs thrown
Reviewed-by: alanb, hannesw
This commit is contained in:
parent
5f4ad59aee
commit
093753dee1
@ -129,10 +129,11 @@ public final class NashornScriptEngineFactory implements ScriptEngineFactory {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getProgram(final String... statements) {
|
public String getProgram(final String... statements) {
|
||||||
|
Objects.requireNonNull(statements);
|
||||||
final StringBuilder sb = new StringBuilder();
|
final StringBuilder sb = new StringBuilder();
|
||||||
|
|
||||||
for (final String statement : statements) {
|
for (final String statement : statements) {
|
||||||
sb.append(statement).append(';');
|
sb.append(Objects.requireNonNull(statement)).append(';');
|
||||||
}
|
}
|
||||||
|
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user