diff -r d382dacfd73f -r 8cb6ebbd4823 rt/emul/mini/src/main/java/java/lang/ClassLoader.java --- a/rt/emul/mini/src/main/java/java/lang/ClassLoader.java Tue Feb 26 16:54:16 2013 +0100 +++ b/rt/emul/mini/src/main/java/java/lang/ClassLoader.java Thu Oct 03 14:45:25 2013 +0200 @@ -180,7 +180,7 @@ * @since 1.2 */ protected ClassLoader(ClassLoader parent) { - throw new SecurityException(); + this.parent = parent; } /** @@ -199,7 +199,7 @@ * of a new class loader. */ protected ClassLoader() { - throw new SecurityException(); + this.parent = null; } // -- Class -- @@ -845,8 +845,27 @@ * @revised 1.4 */ public static ClassLoader getSystemClassLoader() { - throw new SecurityException(); + if (SYSTEM == null) { + SYSTEM = new ClassLoader() { + @Override + protected Enumeration findResources(String name) throws IOException { + return getSystemResources(name); + } + + @Override + protected URL findResource(String name) { + return getSystemResource(name); + } + + @Override + protected Class findClass(String name) throws ClassNotFoundException { + return Class.forName(name); + } + }; + } + return SYSTEM; } + private static ClassLoader SYSTEM; // Returns true if the specified class loader can be found in this class // loader's delegation chain. @@ -870,7 +889,7 @@ } private static URL getBootstrapResource(String name) { - throw new UnsupportedOperationException(); + return Object.class.getResource("/" + name); } private static Enumeration getBootstrapResources(String name) { @@ -910,7 +929,7 @@ } public boolean hasMoreElements() { - if (next == null) { + if (next == null && index < arr.length) { if (arr[index].hasMoreElements()) { next = (URL) arr[index].nextElement(); } else {