Details
-
Bug
-
Resolution: Not an Issue
-
P3
-
None
-
11
-
b01
-
generic
-
generic
Description
A DESCRIPTION OF THE PROBLEM :
reproduce bug code:
import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
import javax.script.ScriptException;
public class Main {
public static void main(String[] args) {
ScriptEngineManager factory = new ScriptEngineManager();
ScriptEngine engine = factory.getEngineByName("nashorn");
try {
String script = "var Long = Java.type('java.lang.Long');" +
"var id = Long.valueOf('1');" +
"print(Long.valueOf('1').equals(id));" +
"print(Long.valueOf('1').getClass());" +
"print(id.getClass());";
engine.eval(script);
} catch (ScriptException se) {
se.printStackTrace();
}
}
}
JDK 11 Output:
false
class java.lang.Long
class java.lang.Integer
JDK 8 Output:
true
class java.lang.Long
class java.lang.Long
REGRESSION : Last worked in version 8u361
FREQUENCY : always
reproduce bug code:
import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
import javax.script.ScriptException;
public class Main {
public static void main(String[] args) {
ScriptEngineManager factory = new ScriptEngineManager();
ScriptEngine engine = factory.getEngineByName("nashorn");
try {
String script = "var Long = Java.type('java.lang.Long');" +
"var id = Long.valueOf('1');" +
"print(Long.valueOf('1').equals(id));" +
"print(Long.valueOf('1').getClass());" +
"print(id.getClass());";
engine.eval(script);
} catch (ScriptException se) {
se.printStackTrace();
}
}
}
JDK 11 Output:
false
class java.lang.Long
class java.lang.Integer
JDK 8 Output:
true
class java.lang.Long
class java.lang.Long
REGRESSION : Last worked in version 8u361
FREQUENCY : always
Attachments
Issue Links
- relates to
-
JDK-8144020 Remove long as an internal numeric type
- Resolved