Skip to content

Conversation

gtoison
Copy link
Contributor

@gtoison gtoison commented Mar 25, 2025

This is a fix for #3350 and should improve the change from #3353

@@ -32,6 +36,10 @@
*/
public final class MemberUtils {

private static final String LOMBOK_GENERATED_TYPE = "Llombok/Generated;";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are other Generated annotations for methods. You don't want to add those as well?

Copy link
Contributor Author

@gtoison gtoison Mar 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was wondering about that too, see:

if (!MemberUtils.isUserGenerated(m)) {

this would effectively set the FOUND_IN_SYNTHETIC_METHOD property for all these generated methods and adjust (increase) the priority (meaning less important) so the bug instances might be silenced.

I'm not sure what might be the consequences to be honest

Copy link
Collaborator

@JuditKnoll JuditKnoll Mar 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for highlighting it. It's a bit strange, that this one is handled a bit differently, but I think it could be okay like this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that a reasonable plan would be to release a first version only considering Lombok's @Generated and, if nothing breaks, expand to other similar annotations in a subsequent version

@hazendaz hazendaz merged commit 672f513 into spotbugs:master Apr 2, 2025
15 checks passed
@hazendaz hazendaz added this to the Spotbugs 4.9.4 milestone Apr 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Do not detect US_USELESS_SUPPRESSION_ON_* warnings on Generated code.
3 participants