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

Spec for javax.script.AbstractScripEngine.getContext() return value is invalid

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 6
    • 6
    • core-libs
    • b91
    • generic
    • generic

      Spec for javax.script.AbstractScripEngine.getContext() says:
      "Returns the value of the protected ScriptContext> field."

      looks like it should be:

      "Returns the value of the protected context field."

      because there is a protected field "context" in javax.script.AbstractScripEngine class

      Also there is a such typo in specification for AbstractScripEngine(Bindings n) constructor:
      "Creates a new instance using the specified Bindings as the ENGINE_SCOPE Bindings in the protected ScriptContext field." - should be "... in protected context field".

      Also there are such typos in specification of methods:
      eval(Reader reader, Bindings bindings)
      get(String key)
      put(String key, Object value)
      setContext(ScriptContext ctxt)

      Also required to add in spec that below methods can throw the NPE
      AbstractScriptEngine(Bindings nn)
      eval(Reader reader)
      eval(String script)
      eval(Reader reader, Bindings bindings)
      eval(String script, Bindings bindings)

      Also AbstractScriptEngine(Bindings n) throws the NPE in case if "n" is null, this is not specified in javadoc spec.

      It is not specified that method setBindings(Bindgins n, int scope) must throw NPE in case if Bindings is null, and scope is ScriptContext.ENGINE_SCOPE

      ###@###.### 2005-06-28 16:46:39 GMT
      ###@###.### 2005-07-06 12:39:36 GMT
      ###@###.### 2005-07-06 12:55:53 GMT
      ###@###.### 2005-07-19 14:27:35 GMT
      ###@###.### 2005-07-19 14:39:32 GMT
      Issue "It is not specified that method setBindings(Bindgins n, int scope) must throw NPE in case if Bindings is null, and scope is ScriptContext.ENGINE_SCOPE" is not fixed in javadoc. Other concerns are fixed.
      For below listed methods exceptions listed in Throws section are not hyperlinks:
      public Bindings getBindings(int scope)
      public void setBindings(Bindings bindings, int scope)

            sundar Sundararajan Athijegannathan
            vsmelovsunw Vladimir Smelov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: