Menu

#693 Broken obfuscation of functional interfaces with default method

v6.0
closed-fixed
None
5
2018-04-01
2018-02-21
No

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)

Discussion

  • Eric Lafortune

    Eric Lafortune - 2018-03-04

    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.

     
  • Eric Lafortune

    Eric Lafortune - 2018-03-04
    • status: open --> open-fixed
    • assigned_to: Eric Lafortune
     
  • Eric Lafortune

    Eric Lafortune - 2018-04-01
    • Status: open-fixed --> closed-fixed
     

Log in to post a comment.

Monday.com Logo