-
Bug
-
Resolution: Fixed
-
P2
-
8u40
-
generic
-
generic
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8085598 | emb-9 | Attila Szegedi | P2 | Resolved | Fixed | team |
JDK-8087033 | 8u65 | Attila Szegedi | P2 | Resolved | Fixed | b01 |
JDK-8073071 | 8u60 | Attila Szegedi | P2 | Closed | Fixed | b06 |
JDK-8138497 | emb-8u65 | Unassigned | P2 | Resolved | Fixed | b01 |
JDK-8076947 | emb-8u60 | Attila Szegedi | P2 | Resolved | Fixed | team |
File: list_conversion.js
Arrays = java.util.Arrays;
print(Arrays.asList("hello world".split(' ')));
The above script works fine with jdk8u31 but fails on jdk8u40 early access build and jdk9 with the following stack trace:
Exception in thread "main" java.lang.ClassCastException: Cannot cast jdk.nashorn.api.scripting.ScriptObjectMirror to [Ljava.lang.Object;
at java.lang.invoke.MethodHandleImpl.newClassCastException(MethodHandleImpl.java:361)
at java.lang.invoke.MethodHandleImpl.castReference(MethodHandleImpl.java:356)
at jdk.nashorn.internal.scripts.Script$list_conversion.:program(list_conversion.js:2)
at jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:636)
at jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:229)
at jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:387)
at jdk.nashorn.tools.Shell.apply(Shell.java:394)
at jdk.nashorn.tools.Shell.runScripts(Shell.java:323)
at jdk.nashorn.tools.Shell.run(Shell.java:169)
at jdk.nashorn.tools.Shell.main(Shell.java:133)
at jdk.nashorn.tools.Shell.main(Shell.java:112)
- backported by
-
JDK-8076947 Arrays.asList results in ClassCastException with a JS array
-
- Resolved
-
-
JDK-8085598 Arrays.asList results in ClassCastException with a JS array
-
- Resolved
-
-
JDK-8087033 Arrays.asList results in ClassCastException with a JS array
-
- Resolved
-
-
JDK-8138497 Arrays.asList results in ClassCastException with a JS array
-
- Resolved
-
-
JDK-8073071 Arrays.asList results in ClassCastException with a JS array
-
- Closed
-
- relates to
-
JDK-8050977 Java8 Javascript Nashorn exception: no current Global instance for nashorn
-
- Resolved
-
(1 relates to)