Uninitialized value of globalScope field of javax.scripting.SimpleScriptContext instances

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P2
    • 6
    • Affects Version/s: 6
    • Component/s: core-libs
    • None
    • b53
    • generic
    • generic
    • Verified

      The specification for field globalContext of class javax.scripting.SimpleScriptContext says: "By default, a SimpleBindings is used." But actually the value of this field is null.
      The following code reproduces the problem:
      import javax.script.Bindings;
      import javax.script.ScriptContext;
      import javax.script.SimpleScriptContext;

      public class Test {
          public static void main(String[] args) {
              final ScriptContext context = new SimpleScriptContext();
              final Bindings globalScope = context.getBindings(ScriptContext.GLOBAL_SCOPE);
              System.out.println(globalScope);
          }
      }

      It prints "null".

      Field engineScope has the same spec assertion, but it has value of type SimpleBindings.
      ###@###.### 2005-07-15 18:47:02 GMT

            Assignee:
            Sundararajan Athijegannathan
            Reporter:
            Alexey Shurygin (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: