Review request 8002212 - adding read/writeObject to additional SerialXXX classes -- Updated

Remi Forax forax at
Sat Nov 3 15:34:02 UTC 2012

On 11/03/2012 03:11 PM, Lance Andersen - Oracle wrote:
> I revised the webrev,, taking into account the vast majority of Remi's suggestions.

in SerialJavaObject, hasStaticFields doesn't work, the original code 
doesn't work because
it only check for fields that are declared static but not for fields 
that are by example public static.

  private static boolean hasStaticFields(Field[] fields) {
         for (Field field : fields) {
             if ( Modifier.isStatic(field.getModifiers())) {
                 return true;
         return false;

This may cause compatibility issue because despite the specification, 
the original code
will let objects that have a static field to be serialized.

Also, in readObject, if obj is null, the code should throw an 
IOException because
it's not possible to create a SerialJavaObject with null has parameter 
(because obj.getClass()
that implictly checks null in the constructor).

All other classes are Ok for me.

> I also added SerialStruct to the webrev.

SerialStruct is Ok for me.

> Have a great weekend.

Have a nice weekend too.

> Best
> Lance


More information about the core-libs-dev mailing list