summaryrefslogtreecommitdiff
path: root/libjava/classpath/java
diff options
context:
space:
mode:
authoraph <aph@138bc75d-0d04-0410-961f-82ee72b054a4>2005-11-15 17:08:45 +0000
committeraph <aph@138bc75d-0d04-0410-961f-82ee72b054a4>2005-11-15 17:08:45 +0000
commit8279285ed3b89cbb2312eb7e08d15629ad8904bd (patch)
treef44359dbdf67a75faef7dbca4c8eceee1c378f77 /libjava/classpath/java
parent73ae46d84410173efd36e8254aead2dc923dc967 (diff)
downloadgcc-8279285ed3b89cbb2312eb7e08d15629ad8904bd.tar.gz
2005-09-16 Andrew Haley <aph@redhat.com>
* java/io/ObjectStreamClass.java (findAccessibleMethod): Allow protected readResolve(). Rewrite accessibility check. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@107027 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/classpath/java')
-rw-r--r--libjava/classpath/java/io/ObjectStreamClass.java17
1 files changed, 9 insertions, 8 deletions
diff --git a/libjava/classpath/java/io/ObjectStreamClass.java b/libjava/classpath/java/io/ObjectStreamClass.java
index b7bd1271324..975dbfc66d0 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)
{