A simple setup reproduces the issue:
@Target({ElementType.METHOD, ElementType.PARAMETER})
@Retention(RetentionPolicy.RUNTIME)
public @interface RuntimeAnnotation {
}
public class ImplementingClass implements DefaultInterface {}
public interface DefaultInterface {
default void something(@RuntimeAnnotation String par) {}
}
Processing this with these proguard flags:
-dontshrink
-dontobfuscate
-dontoptimize
-dontwarn
-dontnote
-target 7
-allowaccessmodification
Will result in the following desugared method:
public void something(java.lang.String);
descriptor: (Ljava/lang/String;)V
flags: (0x0001) ACC_PUBLIC
Code:
stack=0, locals=2, args_size=2
0: return
LineNumberTable:
line 8: 0
LocalVariableTable:
Start Length Slot Name Signature
0 1 0 this Lde/test/DefaultInterface;
0 1 1 par Ljava/lang/String;
RuntimeVisibleParameterAnnotations:
}
Which is clearly incorrect. It not only omits the parameter annotations, but it also emits an invalid section that will result in a java.lang.annotation.AnnotationFormatError
A simple setup reproduces the issue:
Processing this with these proguard flags:
Will result in the following desugared method:
Which is clearly incorrect. It not only omits the parameter annotations, but it also emits an invalid section that will result in a
java.lang.annotation.AnnotationFormatError