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
This commit is contained in:
Andrew Haley 2005-11-15 17:08:45 +00:00 committed by Andrew Haley
parent 55f9959db8
commit 089aaefeba
2 changed files with 14 additions and 8 deletions

View File

@ -1,3 +1,8 @@
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>
* NEWS: Add new features for 0.18.

View File

@ -514,14 +514,15 @@ outer:
{
Method res = c.getDeclaredMethod(name, noArgs);
int mods = res.getModifiers();
if (c != from
&& (Modifier.isPrivate(mods)
|| ! Modifier.isPublic(mods) && ! inSamePackage(c, from)))
continue;
AccessController.doPrivileged(new SetAccessibleAction(res));
return res;
if (c == from
|| Modifier.isProtected(mods)
|| Modifier.isPublic(mods)
|| (! Modifier.isPrivate(mods) && inSamePackage(c, from)))
{
AccessController.doPrivileged(new SetAccessibleAction(res));
return res;
}
}
catch (NoSuchMethodException e)
{