Weird ClassCastException

Tal Liron tal.liron at threecrickets.com
Tue Nov 5 01:17:18 PST 2013


OK, after some work I've managed to isolate the bug. This short program 
will cause the exception:

var x = new java.util.HashMap()
x.put('test', new java.io.File('test'))
if (x.get('test')) {
   print('Found!')
}

The issue seems to be with *casting return values of Java methods* 
(which should cast to boolean; I don't know why it tries to cast to a 
java.langNumber). Simple casting a Java object won't cause the exception.

I'll remind you that this bug appeared only in a recent commit (last few 
days).

On 11/05/2013 03:39 PM, A. Sundararajan wrote:
> No, it is hard to debug with cast issue without access to code.



More information about the nashorn-dev mailing list