>>>>> "Daniel" == Daniel Bonniot <[EMAIL PROTECTED]> 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


_______________________________________________
Classpath-patches mailing list
Classpath-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-patches

Reply via email to