Exclude annotation members from aggressive overloading
Aggressive overloading class members of annotations can cause errors like this:
Caused by: java.lang.annotation.AnnotationFormatError: java.lang.IllegalArgumentException: methods with same signature a() but incompatible return types: boolean and others
at java.base/sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:78)
at java.base/java.lang.reflect.Field.declaredAnnotations(Field.java:1211)
at java.base/java.lang.reflect.Field.declaredAnnotations(Field.java:1209)
at java.base/java.lang.reflect.Field.getAnnotation(Field.java:1176)
This PR excludes annotation class members from aggressive overloading, allowing them to still be obfuscated and for the rest of a project to have aggressive overloading enabled.
Quality Gate passed
Issues
0 New issues
0 Accepted issues
Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code
Is there a problem with how the fix for this bug has been implemented? I'd very much like to be able to enable aggressive overloading for one of my projects, and this bug is the only thing preventing me from doing so.
Hi, thanks for the PR! Apologies for the waiting time.
Do you have a minimal reproduction of the issue that help us understand how you encountered this?
Code looks good, but can you also add an accompanying test?
Quality Gate passed
Issues
0 New issues
0 Accepted issues
Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code
Hi, thanks for the PR! Apologies for the waiting time.
Do you have a minimal reproduction of the issue that help us understand how you encountered this?
Code looks good, but can you also add an accompanying test?
The issue should occur when the JVM attempts to classload any annotation class with multiple fields which has been aggressively overloaded. The unit test I added contains one such annotation class.
The unit test I added contains one such annotation class.
Perfect, thanks!