[8] Review request for 8004970, 8004971, and 8006817: implement serialization in lambda metafactory and metafactory fix

Peter Levart peter.levart at gmail.com
Tue Feb 12 11:10:34 PST 2013

Hi Robert,

Just a minor note on ClassLoaders.

In SerializedLambda.readResolve(), the capturingClass is resolved from 
it's name using the current thread's context ClassLoader. I don't know 
if this is the right thing to do. ObjectInputStream has it's own 
(pluggable) mechanism for resolving classes, which by default uses the 
so called "latest user defined loader" (see 
ObjectInputStream.resolveClass()). It would be better if 
SerializedLambda kept a reference to j.l.Class object representing 
capturingClass and leave to the serialization infrastructure do the 
resolving. But there is a SerializedLambda constructor that only takes a 
String, hm...

I guess other classes that are resolved inside the capturingClass' 
$deserializeLambda$ method are using the caprutingClass' class loader, 
which is ok.

Regards, Peter

On 02/12/2013 04:23 PM, Robert Field wrote:
> Please review the fixes for CRs:
>         http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8004970
>         http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8004971
>         http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8006817
> Webrev:
>         http://cr.openjdk.java.net/~rfield/8004970
> Thank,
> Robert

More information about the lambda-dev mailing list