-
Bug
-
Resolution: Fixed
-
P3
-
8
-
None
-
b117
-
generic
-
generic
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8028846 | port-stage-ppc-aix | Sundararajan Athijegannathan | P3 | Resolved | Fixed | master |
Script:
var x = new java.util.HashMap()
x.put('test', new java.io.File('test'))
if (x.get('test')) {
print('Found!')
}
Exception:
Exception in thread "main" java.lang.ClassCastException: java.io.File cannot be cast to java.lang.Number
at sun.invoke.util.ValueConversions.primitiveConversion(ValueConversions.java:199)
at sun.invoke.util.ValueConversions.unboxBoolean(ValueConversions.java:95)
at jdk.nashorn.internal.scripts.Script$t.runScript(t.js:5)
at jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:498)
at jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:207)
at jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:378)
at jdk.nashorn.tools.Shell.apply(Shell.java:381)
at jdk.nashorn.tools.Shell.runScripts(Shell.java:310)
at jdk.nashorn.tools.Shell.run(Shell.java:166)
at jdk.nashorn.tools.Shell.main(Shell.java:130)
at jdk.nashorn.tools.Shell.main(Shell.java:109)
This was reported by Tal Liron @ nashorn-dev alias.
var x = new java.util.HashMap()
x.put('test', new java.io.File('test'))
if (x.get('test')) {
print('Found!')
}
Exception:
Exception in thread "main" java.lang.ClassCastException: java.io.File cannot be cast to java.lang.Number
at sun.invoke.util.ValueConversions.primitiveConversion(ValueConversions.java:199)
at sun.invoke.util.ValueConversions.unboxBoolean(ValueConversions.java:95)
at jdk.nashorn.internal.scripts.Script$t.runScript(t.js:5)
at jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:498)
at jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:207)
at jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:378)
at jdk.nashorn.tools.Shell.apply(Shell.java:381)
at jdk.nashorn.tools.Shell.runScripts(Shell.java:310)
at jdk.nashorn.tools.Shell.run(Shell.java:166)
at jdk.nashorn.tools.Shell.main(Shell.java:130)
at jdk.nashorn.tools.Shell.main(Shell.java:109)
This was reported by Tal Liron @ nashorn-dev alias.
- backported by
-
JDK-8028846 ClassCastException when converting return value of a Java method to boolean
- Resolved