Review request for 6895456: Eliminate dependency on java.io.ObjectStreamClass during boot

View: New views
5 Messages — Rating Filter:   Alert me  

Review request for 6895456: Eliminate dependency on java.io.ObjectStreamClass during boot

by mandy.chung :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Fixed 6895456: Eliminate dependency on java.io.ObjectStreamClass during boot

Webrev at:
   http://cr.openjdk.java.net/~mchung/6895456/webrev.00/

java.io.ObjectStreamClass is not needed if not doing serialization.  
Move getSignatureClass static method to java.io.ObjectStreamField
class.   ObjectStreamField is always loaded due to the declaration of
serialPersistentFields in a few core classes as they have evolved in the
previous releases.

Thanks
Mandy

Re: Review request for 6895456: Eliminate dependency on java.io.ObjectStreamClass during boot

by Alan Bateman :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Mandy Chung wrote:

> Fixed 6895456: Eliminate dependency on java.io.ObjectStreamClass
> during boot
>
> Webrev at:
>   http://cr.openjdk.java.net/~mchung/6895456/webrev.00/
>
> java.io.ObjectStreamClass is not needed if not doing serialization.  
> Move getSignatureClass static method to java.io.ObjectStreamField
> class.   ObjectStreamField is always loaded due to the declaration of
> serialPersistentFields in a few core classes as they have evolved in
> the previous releases.
I agree it would be good to avoid loading/initializing ObjectStreamClass
(as you say, we have to load ObjectStreamField as the
serialPersistentFields is part of Class, String, and other APIs). My
only concern  is that ObjectStreamField doesn't seem to be the right
place for this (as it's concerned with serializable fields) and it's a
bit strange for ObjectStreamClass to call into ObjectStreamField to get
a class signature. Have you considered alternatives, say duplicating
this method, or maybe a ClassSignature class?

-Alan.


Re: Review request for 6895456: Eliminate dependency on java.io.ObjectStreamClass during boot

by mandy.chung :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Alan Bateman wrote:

> I agree it would be good to avoid loading/initializing
> ObjectStreamClass (as you say, we have to load ObjectStreamField as
> the serialPersistentFields is part of Class, String, and other APIs).
> My only concern  is that ObjectStreamField doesn't seem to be the
> right place for this (as it's concerned with serializable fields) and
> it's a bit strange for ObjectStreamClass to call into
> ObjectStreamField to get a class signature. Have you considered
> alternatives, say duplicating this method, or maybe a ClassSignature
> class?
>

I agree ObjectStreamField is not quite the right place for this method.  
Duplicating this method may be a better option for this case (that I
typically try to avoid).  I can make this change.

I try to avoid adding a new class just for this one method.  I tried to
find an existing class for this method but there doesn't seem to have a
good one.

Mandy


Re: Review request for 6895456: Eliminate dependency on java.io.ObjectStreamClass during boot

by mandy.chung :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> Duplicating this method may be a better option for this case (that I
> typically try to avoid).  I can make this change.
The new webrev at:
   http://cr.openjdk.java.net/~mchung/6895456/webrev.01/

Mandy

Re: Review request for 6895456: Eliminate dependency on java.io.ObjectStreamClass during boot

by Alan Bateman :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Mandy Chung wrote:
>> Duplicating this method may be a better option for this case (that I
>> typically try to avoid).  I can make this change.
> The new webrev at:
>   http://cr.openjdk.java.net/~mchung/6895456/webrev.01/
>
OK, I think I can live with this. While you are there, maybe we should
replace Class with Class<?> as this code is still using raw types.

-Alan.