-
CSR
-
Resolution: Approved
-
P3
-
None
-
behavioral
-
low
-
Throwing NPE more eagerly.
-
Java API
-
SE
Summary
Change specification of javax.script.ScriptEngineFactory.getMethodCallSyntax to throw NullPointerException for null arguments.
Problem
Class: javax.script.ScriptEngineFactory Method: public String getMethodCallSyntax(String obj, String m, String... args);
This method does not specify behavior on null arguments (null for obj, null for m, null for args or any of the elements of args).
Solution
javadoc comment will be modified to explicitly state that NullPointerException is thrown for any null argument.
Specification
diff -r acfedb75dd51 src/java.scripting/share/classes/javax/script/ScriptEngineFactory.java
--- a/src/java.scripting/share/classes/javax/script/ScriptEngineFactory.java Tue Nov 14 08:59:19 2017 +0530
+++ b/src/java.scripting/share/classes/javax/script/ScriptEngineFactory.java Tue Nov 14 14:46:12 2017 +0530
@@ -176,6 +176,8 @@
* @param args names of the arguments in the method call.
*
* @return The String used to invoke the method in the syntax of the scripting language.
+ *
+ * @throws NullPointerException if obj or m or args or any of the elements of args is null.
*/
public String getMethodCallSyntax(String obj, String m, String... args);
- csr of
-
JDK-8068741 javax.script.ScriptEngineFactory.getMethodCallSyntax() spec allows null passed as an object
-
- Resolved
-