aboutsummaryrefslogtreecommitdiff
path: root/libjava/java/io/ObjectInputStream.java
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2005-06-01 19:58:25 +0000
committerTom Tromey <tromey@gcc.gnu.org>2005-06-01 19:58:25 +0000
commitcd3352b625b40e18a95bb5db35de31b8951e4d82 (patch)
tree12419b4dbd84dc19200216a422ba5bca825d6f32 /libjava/java/io/ObjectInputStream.java
parentc3a29423de8cfb7e2b5642b9d44eb21e4b286aec (diff)
downloadgcc-cd3352b625b40e18a95bb5db35de31b8951e4d82.zip
gcc-cd3352b625b40e18a95bb5db35de31b8951e4d82.tar.gz
gcc-cd3352b625b40e18a95bb5db35de31b8951e4d82.tar.bz2
re PR libgcj/21785 (ClassNotFound during deserialization)
PR libgcj/21785: * java/io/natObjectInputStream.cc (currentClassLoader): Removed. (currentLoader): New method. * java/io/ObjectInputStream.java (resolveProxyClass): Use currentLoader. (currentLoader): Now native. (currentClassLoader): Removed. * testsuite/libjava.lang/pr21785.java: New file. * testsuite/libjava.lang/pr21785.out: New file. From-SVN: r100462
Diffstat (limited to 'libjava/java/io/ObjectInputStream.java')
-rw-r--r--libjava/java/io/ObjectInputStream.java34
1 files changed, 5 insertions, 29 deletions
diff --git a/libjava/java/io/ObjectInputStream.java b/libjava/java/io/ObjectInputStream.java
index 2cfe4c9..0a97486 100644
--- a/libjava/java/io/ObjectInputStream.java
+++ b/libjava/java/io/ObjectInputStream.java
@@ -783,21 +783,11 @@ public class ObjectInputStream extends InputStream
}
/**
- * This method invokes the method currentClassLoader for the
- * current security manager (or build an empty one if it is not
- * present).
- *
- * @return The most recent non-system ClassLoader on the execution stack.
- * @see java.lang.SecurityManager#currentClassLoader()
+ * Returns he most recent user defined ClassLoader on the execution stack
+ * or null of none is found.
*/
- private ClassLoader currentLoader()
- {
- SecurityManager sm = System.getSecurityManager();
- if (sm == null)
- sm = new SecurityManager () {};
-
- return currentClassLoader(sm);
- }
+ // GCJ LOCAL: native method.
+ private native ClassLoader currentLoader();
/**
* Lookup a class stored in the local hashtable. If it is not
@@ -883,12 +873,7 @@ public class ObjectInputStream extends InputStream
protected Class resolveProxyClass(String[] intfs)
throws IOException, ClassNotFoundException
{
- SecurityManager sm = System.getSecurityManager();
-
- if (sm == null)
- sm = new SecurityManager() {};
-
- ClassLoader cl = currentClassLoader(sm);
+ ClassLoader cl = currentLoader();
Class[] clss = new Class[intfs.length];
if(cl == null)
@@ -1866,15 +1851,6 @@ public class ObjectInputStream extends InputStream
}
}
- /**
- * This native method is used to get access to the protected method
- * of the same name in SecurityManger.
- *
- * @param sm SecurityManager instance which should be called.
- * @return The current class loader in the calling stack.
- */
- private static native ClassLoader currentClassLoader (SecurityManager sm);
-
private void callReadMethod (Method readObject, Class klass, Object obj)
throws ClassNotFoundException, IOException
{