I have several public methods annotated with @Transactional
and IntelliJ shows the warning that they can be package-private or private.
@Transactional
public void doSomething() {
///body
}
Since methods annotated with @Transactional
should be public, how can I disable in IntelliJ this inspection/warning only for those methods?
Sadly, it isn't possible to make all methods annotated with @Transactional
clear the warning, although it is possible to add @SuppressWarnings("WeakerAccess")
to make the warning go away.
Alternatively, you can disable this inspection altogether in IntelliJ IDEA by going to File
→Settings
→Editor
→Inspections
.
In the list show in this view you will want to navigate through the subcategories: Java
→Declaration redundancy
and uncheck the checkbox called "Declaration access can be weaker" that will be available then. If you wish to disable this for future projects, choose the profile "Default" from the dropdown menu labelled "Profile", otherwise, just do this for "Project Default".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With