Skip to content
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

Don't warn if methods annotated @PreDestroy / @PostConstruct are unused #1705

Closed
wants to merge 1 commit into from

Conversation

kriths
Copy link
Contributor

@kriths kriths commented Jul 6, 2020

Methods annotated with @PreDestroy and @PostConstruct are managed by Java EE and the Java spec describes "The method [...] MAY be public, protected, package private or private". So I'd argue there shouldn't be are warning for private methods annotated with either of those annotations.

Those two annotations were also mentioned in #1235

See:
https://docs.oracle.com/javase/8/docs/api/javax/annotation/PostConstruct.html
https://docs.oracle.com/javase/8/docs/api/javax/annotation/PreDestroy.html

Copy link
Contributor

@eaftan eaftan left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution. By approving this, this PR will get transformed into an internal commit and then pushed back out, closing this PR. Please be patient while this happens.

@copybara-service copybara-service bot closed this in c619de8 Jul 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants