classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cp-patches] Serialization: readResolve and writeReplace in parent c


From: Tom Tromey
Subject: Re: [cp-patches] Serialization: readResolve and writeReplace in parent class
Date: 27 Jun 2005 08:50:09 -0600
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

>>>>> "Daniel" == Daniel Bonniot <address@hidden> writes:

Daniel> Purpose: readResolve and writeReplace are currently only looked for in
Daniel> the current class, while accessible parent methods must also be
Daniel> considered. This is what this patch does.

Looks good to me fwiw.  A couple minor nits ...

Daniel> +  private static boolean inSamePackage(Class c1, Class c2)

This seems like it must be duplicated somewhere, but I couldn't find
it quickly.  There is getPackagePortion in Class, maybe making that
package-private and then using it would be good.

Daniel> +           Method res = c.getDeclaredMethod(name, noArgs);
Daniel> +           int mods = res.getModifiers();
Daniel> +           if (c != from &&
Daniel> +               (Modifier.isPrivate(mods) ||
Daniel> +                !Modifier.isPublic(mods) && ! inSamePackage(c, from)))
Daniel> +             continue;

GNU style is to put line breaks before operators, not after them.


I wonder if there is a strange case here where someone adds a private
method to the class hierarchy "later" (after all the other classes are
compiled).  Should the private method hide the superclass methods of
the same signature?  Perhaps this is an incompatible change, offhand I
forget.

Tom




reply via email to

[Prev in Thread] Current Thread [Next in Thread]