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

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • 6
    • 6
    • 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

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: