From fe09dab129415da5abf880c63478f725a3735fec Mon Sep 17 00:00:00 2001 From: gary Date: Mon, 7 Aug 2006 14:48:59 +0000 Subject: 2006-08-07 Gary Benson PR libgcj/28340: * java/lang/ClassLoader.java (clinit): Install a default security manager if java.security.manager is defined. (getParent, getSystemClassLoader): Use the correct stack frame during security checks. * java/net/URLClassLoader.java (findClass): Avoid calling this.toString() during VM initialization. (runtimeInitialized): New method. * java/net/natURLClassLoader.cc: New file. * Makefile.am (nat_source_files): Added the above. * Makefile.in: Rebuilt. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@115999 138bc75d-0d04-0410-961f-82ee72b054a4 --- libjava/java/net/URLClassLoader.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'libjava/java/net/URLClassLoader.java') diff --git a/libjava/java/net/URLClassLoader.java b/libjava/java/net/URLClassLoader.java index ada4b637c32..06db7d58217 100644 --- a/libjava/java/net/URLClassLoader.java +++ b/libjava/java/net/URLClassLoader.java @@ -1078,7 +1078,12 @@ public class URLClassLoader extends SecureClassLoader resource = loader.getResource(resourceName); } if (resource == null) - throw new ClassNotFoundException(className + " not found in " + this); + { + String message = className + " not found"; + if (runtimeInitialized()) + message += " in " + this; + throw new ClassNotFoundException(message); + } // Try to read the class data, create the CodeSource, Package and // construct the class (and watch out for those nasty IOExceptions) @@ -1437,4 +1442,11 @@ public class URLClassLoader extends SecureClassLoader return loader; } } + + /** + * Tell whether runtime initialization is complete. + * + * @return whether runtime initialization is complete. + */ + private static native boolean runtimeInitialized(); } -- cgit v1.2.3