Inspectopedia
 
2024.3

Declaration access can be weaker

Warning
New
Last modified: 03 December 2024

Reports fields, methods or classes that may have their access modifier narrowed down.

Example:

After the quick-fix is applied:

Use the inspection's options to define the rules for the modifier change suggestions.