Inspectopedia
 
2024.3

Declaration can have 'final' modifier

Warning
New
Last modified: 03 December 2024

Reports fields, methods, or classes that may have the final modifier added to their declarations.

Final classes can't be extended, final methods can't be overridden, and final fields can't be reassigned.

Example:

After the quick-fix is applied:

Use the Report classes and Report methods options to define which declarations are to be reported.