diff --git a/retrolambda/src/main/java/net/orfjackal/retrolambda/Transformers.java b/retrolambda/src/main/java/net/orfjackal/retrolambda/Transformers.java index 58995d62..2640ad79 100644 --- a/retrolambda/src/main/java/net/orfjackal/retrolambda/Transformers.java +++ b/retrolambda/src/main/java/net/orfjackal/retrolambda/Transformers.java @@ -126,7 +126,7 @@ private byte[] transform(String className, Consumer reader, ClassV if (className != null) { className = className.replace('/', '.'); } - throw new RuntimeException("Failed to transform class " + className, t); + throw new RuntimeException("Failed to backport class: " + className, t); } } diff --git a/retrolambda/src/main/java/net/orfjackal/retrolambda/lambdas/LambdaClassSaver.java b/retrolambda/src/main/java/net/orfjackal/retrolambda/lambdas/LambdaClassSaver.java index 028a1427..760807ac 100644 --- a/retrolambda/src/main/java/net/orfjackal/retrolambda/lambdas/LambdaClassSaver.java +++ b/retrolambda/src/main/java/net/orfjackal/retrolambda/lambdas/LambdaClassSaver.java @@ -8,6 +8,8 @@ import net.orfjackal.retrolambda.files.OutputDirectory; import org.objectweb.asm.ClassReader; +import java.io.IOException; + public class LambdaClassSaver { private final OutputDirectory saver; @@ -25,14 +27,12 @@ public void saveIfLambda(String className, byte[] bytecode) { } private void reifyLambdaClass(String className, byte[] bytecode) { + System.out.println("Saving lambda class: " + className); + bytecode = transformers.backportLambdaClass(new ClassReader(bytecode)); try { - System.out.println("Saving lambda class: " + className); - saver.writeClass(transformers.backportLambdaClass(new ClassReader(bytecode))); - - } catch (Throwable t) { - // print to stdout to keep in sync with other log output - System.out.println("ERROR: Failed to backport lambda class: " + className); - t.printStackTrace(System.out); + saver.writeClass(bytecode); + } catch (IOException e) { + throw new RuntimeException(e); } } }