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

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 10
    • 9
    • core-libs
    • None

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



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

              Created:
              Updated:
              Resolved: