I don't know if you're already accepting Bug Reports for the 5.0 Beta but here's what I ran into:
When you obfuscate Java 8 code containing a lambda expression that uses the "this" reference, a java.lang.NoClassDefFoundError is thrown when you try to run the program.
Here's a sample code that reproduces the error:
public class Main { public static void main(String[] args) { new Test().test(); } } public class Test { public void test() { List<Integer> l = new ArrayList<>(); l.add(1); l.add(2); l.add(3); l.add(4); l.forEach((num) -> System.out.println(this)); } }
Stacktrace:
Exception in thread "main" java.lang.NoClassDefFoundError: Test
at Main.main(Unknown Source)
Caused by: java.lang.ClassNotFoundException: Test
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 1 more
I've also attached the ProGuard config file I was using.
Sorry, wrote a wrong answer.
Last edit: Fabyan Alexander Belz Hesse 2014-05-08
Thanks for your concise report. I can reproduce the problem. I'll fix it for the upcoming ProGuard 5.0 beta2.