1.1 --- a/rt/aot/src/main/java/org/apidesign/bck2brwsr/aot/RetroLambda.java Sat Sep 13 13:44:01 2014 +0200
1.2 +++ b/rt/aot/src/main/java/org/apidesign/bck2brwsr/aot/RetroLambda.java Sat Sep 13 16:11:42 2014 +0200
1.3 @@ -47,9 +47,8 @@
1.4 public void saveIfLambda(String className, byte[] bytecode) {
1.5 if (LambdaReifier.isLambdaClassToReify(className)) {
1.6 try {
1.7 - System.out.println("Saving lambda class: " + className);
1.8 byte[] backportedBytecode = LambdaClassBackporter.transform(bytecode, Opcodes.V1_7);
1.9 - putBytecode(className, backportedBytecode);
1.10 + putBytecode(className + ".class", backportedBytecode);
1.11 } catch (Throwable t) {
1.12 // print to stdout to keep in sync with other log output
1.13 throw new IllegalStateException("ERROR: Failed to backport lambda class: " + className);
1.14 @@ -58,6 +57,7 @@
1.15 }
1.16
1.17 private void putBytecode(String className, byte[] backportedBytecode) {
1.18 + assert className.endsWith(".class") : "Full resource: " + className;
1.19 if (converted == null) {
1.20 converted = new HashMap<>();
1.21 }
1.22 @@ -84,6 +84,8 @@
1.23 if (!Arrays.equals(newB, byteCode)) {
1.24 putBytecode(className, newB);
1.25 }
1.26 + } catch (Throwable t) {
1.27 + t.printStackTrace();
1.28 } finally {
1.29 Thread.currentThread().setContextClassLoader(prev);
1.30 }
1.31 @@ -106,6 +108,9 @@
1.32 if (c != null) {
1.33 return c;
1.34 }
1.35 + if (name.startsWith("java.")) {
1.36 + return super.loadClass(name);
1.37 + }
1.38 String r = name.replace('.', '/') + ".class";
1.39 try (InputStream is = res.get(r)) {
1.40 if (is == null) {