Disable "Access may be a private package" warning for @Transactional methods
I have several public methods annotated with @Transactional
and IntelliJ is showing a warning that they can be private or private.
@Transactional
public void doSomething() {
///body
}
Since the methods annotated with @Transactional
must be public, how can I disable IntelliJ's checking / warning for these methods only ?
source to share
Unfortunately, it is not possible to make all methods annotated with @Transactional
remove the warning, although it can be added @SuppressWarnings("WeakerAccess")
to make the warning disappear.
Alternatively, you can turn off this check entirely in IntelliJ IDEA by going to File
→ Settings
→ Editor
→ Inspections
. In the list view in that view, you will want to navigate to the subcategories: Java
→ Declaration redundancy
and uncheck the "Declaration access may be weaker" checkbox that will be available. If you want to disable this for future projects, select the "Default" profile from the drop-down menu labeled "Profile", otherwise just do it for "Project Default".
source to share