diff options
author | Andrew Haley <aph@redhat.com> | 2005-11-15 17:08:45 +0000 |
---|---|---|
committer | Andrew Haley <aph@gcc.gnu.org> | 2005-11-15 17:08:45 +0000 |
commit | 089aaefeba28e15f27c16aca7542bc5cee773a33 (patch) | |
tree | f44359dbdf67a75faef7dbca4c8eceee1c378f77 /libjava/classpath | |
parent | 55f9959db8abb3eef85c7f19d55b14c24c325579 (diff) | |
download | gcc-089aaefeba28e15f27c16aca7542bc5cee773a33.zip gcc-089aaefeba28e15f27c16aca7542bc5cee773a33.tar.gz gcc-089aaefeba28e15f27c16aca7542bc5cee773a33.tar.bz2 |
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
Diffstat (limited to 'libjava/classpath')
-rw-r--r-- | libjava/classpath/ChangeLog | 5 | ||||
-rw-r--r-- | libjava/classpath/java/io/ObjectStreamClass.java | 17 |
2 files changed, 14 insertions, 8 deletions
diff --git a/libjava/classpath/ChangeLog b/libjava/classpath/ChangeLog index 6463f49..e1868f2 100644 --- a/libjava/classpath/ChangeLog +++ b/libjava/classpath/ChangeLog @@ -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. diff --git a/libjava/classpath/java/io/ObjectStreamClass.java b/libjava/classpath/java/io/ObjectStreamClass.java index b7bd127..975dbfc6 100644 --- a/libjava/classpath/java/io/ObjectStreamClass.java +++ b/libjava/classpath/java/io/ObjectStreamClass.java @@ -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) { |