-
Bug
-
Resolution: Not an Issue
-
P3
-
None
-
8u60, 9
-
x86_64
-
windows_7
FULL PRODUCT VERSION :
java version "1.8.0_60"
java(TM) SE Rutime Environment (build 1.8.0_60-b27)
java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 6.1.7601]
A DESCRIPTION OF THE PROBLEM :
import javax.script.ScriptContext;
import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
public static void main(String[] args) {
ScriptEngineManager manager = new ScriptEngineManager();
ScriptEngine engine1 = manager.getEngineByName("nashorn");
engine1.eval("var sum = 0;");
// set global variable
manager.setBindings(engine1.getBindings(ScriptContext.ENGINE_SCOPE));
ScriptEngine engine2 = manager.getEngineByName("nashorn");
engine2.eval("sum = 150;", engine2.createBindings());
engine2.eval("print(sum);", engine2.createBindings());
}
Expected output: 150
Actual output: 0
------------------------------------------
run with Java SE 7, output 150.
REGRESSION. Last worked in version 7u80
REPRODUCIBILITY :
This bug can be reproduced always.
java version "1.8.0_60"
java(TM) SE Rutime Environment (build 1.8.0_60-b27)
java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 6.1.7601]
A DESCRIPTION OF THE PROBLEM :
import javax.script.ScriptContext;
import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
public static void main(String[] args) {
ScriptEngineManager manager = new ScriptEngineManager();
ScriptEngine engine1 = manager.getEngineByName("nashorn");
engine1.eval("var sum = 0;");
// set global variable
manager.setBindings(engine1.getBindings(ScriptContext.ENGINE_SCOPE));
ScriptEngine engine2 = manager.getEngineByName("nashorn");
engine2.eval("sum = 150;", engine2.createBindings());
engine2.eval("print(sum);", engine2.createBindings());
}
Expected output: 150
Actual output: 0
------------------------------------------
run with Java SE 7, output 150.
REGRESSION. Last worked in version 7u80
REPRODUCIBILITY :
This bug can be reproduced always.