Commit 089aaefe by Andrew Haley Committed by Andrew Haley

ObjectStreamClass.java (findAccessibleMethod): Allow protected readResolve().

2005-09-16  Andrew Haley  <aph@redhat.com>

        * java/io/ObjectStreamClass.java (findAccessibleMethod): Allow
        protected readResolve().  Rewrite accessibility check.

From-SVN: r107027
parent 55f9959d
2005-09-16 Andrew Haley <aph@redhat.com>
* java/io/ObjectStreamClass.java (findAccessibleMethod): Allow
protected readResolve(). Rewrite accessibility check.
2005-09-06 Mark Wielaard <mark@klomp.org> 2005-09-06 Mark Wielaard <mark@klomp.org>
* NEWS: Add new features for 0.18. * NEWS: Add new features for 0.18.
......
...@@ -514,14 +514,15 @@ outer: ...@@ -514,14 +514,15 @@ outer:
{ {
Method res = c.getDeclaredMethod(name, noArgs); Method res = c.getDeclaredMethod(name, noArgs);
int mods = res.getModifiers(); int mods = res.getModifiers();
if (c != from if (c == from
&& (Modifier.isPrivate(mods) || Modifier.isProtected(mods)
|| ! Modifier.isPublic(mods) && ! inSamePackage(c, from))) || Modifier.isPublic(mods)
continue; || (! Modifier.isPrivate(mods) && inSamePackage(c, from)))
{
AccessController.doPrivileged(new SetAccessibleAction(res)); AccessController.doPrivileged(new SetAccessibleAction(res));
return res; return res;
}
} }
catch (NoSuchMethodException e) catch (NoSuchMethodException e)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment