db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alan Burlison <Alan.Burli...@sun.com>
Subject Re: Returning NULL from a database-side Java function
Date Wed, 10 Oct 2007 09:46:36 GMT
Alan Burlison wrote:

> So it is autoboxing to Integer, then calling intValue().  This sure 
> looks like a Java bug to me, I've asked internally to see if anyone can 
> confirm, and if so I'll raise a bug against javac.

The relevant part of the Java spec is here:

http://java.sun.com/docs/books/jls/third_edition/html/expressions.html#15.25

To paraphrase, the compiler is using autoboxing to convert '1' and 
'null' to the same type (Integer), then using intValue() to convert back 
to an int.

It's probably not an out-and-out bug, more like a dark corner of 
Autoboxing :-)

-- 
Alan Burlison
--

Mime
View raw message