Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8191201

javax.script.ScriptEngineFactory.getMethodCallSyntax() spec should not allow null be passed as an argument

    Details

    • Type: CSR
    • Status: Closed
    • Priority: P3
    • Resolution: Approved
    • Fix Version/s: 10
    • Component/s: core-libs
    • Labels:
      None
    • Subcomponent:
    • Compatibility Kind:
      behavioral
    • Compatibility Risk:
      low
    • Compatibility Risk Description:
      Throwing NPE more eagerly.
    • Interface Kind:
      Java API
    • Scope:
      SE

      Description

      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);
      
      
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                sundar Sundararajan Athijegannathan
                Reporter:
                dbessono Dmitry Bessonov
                Reviewed By:
                Jim Laskey
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: