Declaration access can be weaker
Reports fields, methods or classes that may have their access modifier narrowed down.
Example:
After the quick-fix is applied:
Locating this inspection
- By ID
Can be used to locate inspection in e.g. Qodana configuration files, where you can quickly enable or disable it, or adjust its settings.
WeakerAccess- Via Settings dialog
Path to the inspection settings via IntelliJ Platform IDE Settings dialog, when you need to adjust inspection settings directly from your IDE.
Use the inspection's options to define the rules for the modifier change suggestions.
Inspection options
Here you can find the description of settings available for the Declaration access can be weaker inspection, and the reference of their default values.
- Suggest package-private visibility level for class members
Default: Selected
- Suggest package-private visibility level for top-level classes
Default: Selected
- Suggest 'private' for inner class members when referenced from outer class only
Not selected
- Suggest weaker visibility for constants
Default: Selected
- Suggest package-private visibility level for classes in exported packages (Java 9+)
Default: Selected
- Suggest package-private visibility level for junit 5 tests
Default: Selected
Inspection Details | |
---|---|
By default bundled with: | |
Can be installed with plugin: | Java, 242.22892 |