Re: Question on layer/peeling

Timo Kinnunen timo.kinnunen at
Tue Jan 6 22:14:56 UTC 2015

The type in bytecode will be Object, but the type in source code will be V, with V=boxed complex number, for example. The idiom I’m thinking of is

Complex complex = numbers.get(nonexistentKey);

if(complex == null) return;


(Complex is a value type, numbers is a Java 5 hash map)

Have a nice day,

Sent from Windows Mail

From: John Rose
Sent: ‎Tuesday‎, ‎January‎ ‎6‎, ‎2015 ‎23‎:‎09
To: Timo Kinnunen
Cc: Brian Goetz, Michael Barker, valhalla-dev at

On Jan 6, 2015, at 1:00 PM, Timo Kinnunen <timo.kinnunen at> wrote:
> Before assigning semantics to x == null, let’s not forget boxing. What will happen if x is a boxed value which was returned from a call to the non-specialized Map.get(Object key) method?

?  Then the comparison will be false.  In any case the type of x there is Object, isn't it, so there's nothing new here?  — John

More information about the valhalla-dev mailing list