Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Enhance plugin - Option to add @SuppressFBWarnings annotation #5668

NicklasWallgren started this conversation in Design Proposals
Discussion options

Lombok has an option to add @SuppressFBWarnings to generated code via lombok.extern.findbugs.addSuppressFBWarnings
It would be really helpful if the hibernate gradle/maven enhance plugins would provide a similar option.

We're currently struggling with warnings related to hibernate generated code in our entities, in SpotBugs.

NP | Non-null field $_hibernate_attributeInterceptor is not initialized by new <entity>
NP | Non-null field $_hibernate_entityEntryHolder is not initialized by new <entity>
NP | Non-null field $_hibernate_nextManagedEntity is not initialized by new <entity>
NP | Non-null field $_hibernate_previousManagedEntity is not initialized by new <entity>
NP | Non-null field $_hibernate_tracker is not initialized by new <entity>
You must be logged in to vote

Replies: 2 comments 5 replies

Comment options

Sure, sounds reasonable :) Will you try a patch?

You must be logged in to vote
5 replies
Comment options

Great, I'm not to familiar with code base, but I took a first stab at it.
main...NicklasWallgren:hibernate-orm:option-to-add-suppress-fb-warnings

Am I on the right track? 🙂

Comment options

Sanne Dec 2, 2022
Maintainer

I think so, yes!

Comment options

Great, thanks.

I opened a PR, #5790

Comment options

It would also be nice to add the jakarta.annotation.Generated annotation, so that tools like Jacoco can exclude hibernate-generated fields and methods from coverage reports.

Comment options

@Sanne How should we processed with this issue, should I update the PR?

Comment options

We discussed this as a team and the consensus was that we are not really keen on the idea of adding support for particular annotations one-by-one. We believe this is a use case that can be generalized.

Let's discuss approaches for that here or on Zulip

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

AltStyle によって変換されたページ (->オリジナル) /