diff -r 35daab73e225 -r 3238bffeaf12 rt/aot/src/main/java/org/apidesign/bck2brwsr/aot/RetroLambda.java --- a/rt/aot/src/main/java/org/apidesign/bck2brwsr/aot/RetroLambda.java Sat Sep 13 13:44:01 2014 +0200 +++ b/rt/aot/src/main/java/org/apidesign/bck2brwsr/aot/RetroLambda.java Sat Sep 13 16:11:42 2014 +0200 @@ -47,9 +47,8 @@ public void saveIfLambda(String className, byte[] bytecode) { if (LambdaReifier.isLambdaClassToReify(className)) { try { - System.out.println("Saving lambda class: " + className); byte[] backportedBytecode = LambdaClassBackporter.transform(bytecode, Opcodes.V1_7); - putBytecode(className, backportedBytecode); + putBytecode(className + ".class", backportedBytecode); } catch (Throwable t) { // print to stdout to keep in sync with other log output throw new IllegalStateException("ERROR: Failed to backport lambda class: " + className); @@ -58,6 +57,7 @@ } private void putBytecode(String className, byte[] backportedBytecode) { + assert className.endsWith(".class") : "Full resource: " + className; if (converted == null) { converted = new HashMap<>(); } @@ -84,6 +84,8 @@ if (!Arrays.equals(newB, byteCode)) { putBytecode(className, newB); } + } catch (Throwable t) { + t.printStackTrace(); } finally { Thread.currentThread().setContextClassLoader(prev); } @@ -106,6 +108,9 @@ if (c != null) { return c; } + if (name.startsWith("java.")) { + return super.loadClass(name); + } String r = name.replace('.', '/') + ".class"; try (InputStream is = res.get(r)) { if (is == null) {