Broken obfuscation of functional interfaces with default method
Java class file shrinker, optimizer, obfuscator, and preverifier
Brought to you by:
guardsquare
The following test runs fine when obfuscated by Proguard 5.3.3, but throws AbstractMethodError with Proguard 6.0:
package com.example;
public class LambdaMain {
@FunctionalInterface
public interface BaseLambda {
void run(Object x);
}
@FunctionalInterface
public interface SubLambda extends BaseLambda {
@Override
default void run(Object x) {
run();
}
void run();
}
public static void main(String[] args) {
SubLambda subLambda = () -> System.out.println("Hello world!");
subLambda.run("");
}
}
Stacktrace:
Exception in thread "main" java.lang.AbstractMethodError: Method com/example/LambdaMain$$Lambda$8.a()V is abstract
at com.example.LambdaMain$$Lambda$8/305623748.a(Unknown Source)
at com.example.b.a(SourceFile:13)
at com.example.LambdaMain.main(SourceFile:21)
Thanks for your detailed report. I could reproduce the issue with your sample (with -dontshrink). It has now been fixed for the upcoming ProGuard 6.0.1.