-
Notifications
You must be signed in to change notification settings - Fork 424
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proguard incorrectly backports default interface method parameter annotations #451
Comments
fwiw, adding this patch to proguard core fixes it: diff --git a/src/main/java/proguard/classfile/editor/AttributeAdder.java b/src/main/java/proguard/classfile/editor/AttributeAdder.java
--- a/src/main/java/proguard/classfile/editor/AttributeAdder.java (revision c30881360ad88dcd21f391828d9933b6b6fa5071)
+++ b/src/main/java/proguard/classfile/editor/AttributeAdder.java (date 1732721183375)
@@ -538,7 +538,7 @@
RuntimeVisibleParameterAnnotationsAttribute newParameterAnnotationsAttribute =
new RuntimeVisibleParameterAnnotationsAttribute(constantAdder.addConstant(clazz, runtimeVisibleParameterAnnotationsAttribute.u2attributeNameIndex),
- 0,
+ runtimeVisibleParameterAnnotationsAttribute.u1parametersCount,
new int[runtimeVisibleParameterAnnotationsAttribute.u1parametersCount],
parameterAnnotations);
@@ -565,7 +565,7 @@
RuntimeInvisibleParameterAnnotationsAttribute newParameterAnnotationsAttribute =
new RuntimeInvisibleParameterAnnotationsAttribute(constantAdder.addConstant(clazz, runtimeInvisibleParameterAnnotationsAttribute.u2attributeNameIndex),
- 0,
+ runtimeInvisibleParameterAnnotationsAttribute.u1parametersCount,
new int[runtimeInvisibleParameterAnnotationsAttribute.u1parametersCount],
parameterAnnotations);
|
Hello, Thank you for getting in touch with us. I am unfortunately unable to reproduce this issue with the current version of ProGuard (i.e. 7.6), with the example setup you gave. In order to also help us review proguard-core #130, can you provide:
|
Hi @tvoc-gs
|
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
The text was updated successfully, but these errors were encountered: