On 11/03/2012 03:11 PM, Lance Andersen - Oracle wrote:
I revised the webrev, http://cr.openjdk.java.net/~lancea/8002212/webrev.01, 
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

cheers,
Rémi

Reply via email to