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

javax.script.ScriptEngineFactory.getMethodCallSyntax() spec allows null passed as an object

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 9
    • Fix Version/s: 10
    • Component/s: core-libs
    • Labels:
      None

      Description

      The spec
      http://docs.oracle.com/javase/8/docs/api/javax/script/ScriptEngineFactory.html#getMethodCallSyntax-java.lang.String-java.lang.String-java.lang.String...-
      says nothing about NPE of ScriptException throwing for nulls passed as obj or method name.

      However at least for "obj - The name representing the object whose method is to be invoked." passing null doesn't make any sense since it is not possible to create a binding using null as a key.

      Nashorn implementation allows null obj and method name and fails later on evaluation of the returned statement.

      new ScriptEngineManager().getEngineFactories().forEach(f -> f.getMethodCallSyntax(null, "method"));



        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                sundar Sundararajan Athijegannathan
                Reporter:
                dbessono Dmitry Bessonov
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: