javax.script.Bindings hides "Date" key

XMLWordPrintable

    • Type: Bug
    • Resolution: Won't Fix
    • Priority: P4
    • None
    • Affects Version/s: 8
    • Component/s: core-libs

      FULL PRODUCT VERSION :
      java version "1.8.0"
      Java(TM) SE Runtime Environment (build 1.8.0-b132)
      Java HotSpot(TM) Client VM (build 25.0-b70, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Windows 7 32-bit

      A DESCRIPTION OF THE PROBLEM :
      javax.script.Bindings hides "Date" key.
      After
              bindings.put("Abc", "123");
              bindings.put("Date", "666");
              bindings.put("Time", "777");
              bindings.put("Xyz", "789");
      it says it only contains "Abc", "Time" and "Xyz".

      Please find the evidence test case below:



      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Execute the following statements:
              bindings.put("Abc", "123");
              bindings.put("Date", "666");
              bindings.put("Time", "777");
              bindings.put("Xyz", "789");
      And then print "bindings" variable.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      bindings = [Abc=123, Date=666, Time=777, Xyz=789]
      bindings['Date'] = 666
      ACTUAL -
      bindings = [Abc=123, Time=777, Xyz=789]
      bindings['Date'] = 666

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import javax.script.Bindings;
      import javax.script.ScriptEngine;
      import javax.script.ScriptEngineManager;

      public class BindingsBugTest {
          public static void main(String... args) {
              ScriptEngine scriptEngine = new ScriptEngineManager().getEngineByName("JavaScript");
              final Bindings bindings = scriptEngine.createBindings();
              bindings.put("Abc", "123");
              bindings.put("Date", "666");
              bindings.put("Time", "777");
              bindings.put("Xyz", "789");
              System.out.println("bindings = " + bindings.entrySet());
              System.out.println("bindings['Date'] = " + bindings.get("Date"));
          }

      }
      ---------- END SOURCE ----------

      SUPPORT :
      YES

            Assignee:
            Sundararajan Athijegannathan
            Reporter:
            Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: