You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[java] Merge rules about protected in final class (AvoidProtectedFieldInFinalClass, AvoidProtectedMethodInFinalClassNotExtending) #2974
a:new-ruleProposal to add a new built-in rulean:enhancementAn improvement on existing features / rulesis:deprecationThe main focus is deprecating public APIs or rules, eg to make them internal, or removing them
I think we should merge AvoidProtectedFieldInFinalClass and AvoidProtectedMethodInFinalClassNotExtending. Just like for #2892, it's useless to have a distinction when the fix is the same. The names are also long and clumsy, and give too much detail about the implementation, which doesn't allow us to extend the behavior of the rules.
Proposed rule name: "ProtectedMemberInFinalClass" in design.xml and not codestyle.
Other improvements we can make to this new rule:
protected nested types
protected members in an anonymous class, enum, or record
only ignore methods that override an inherited method (so stop checking blindly for an ExtendsList)
For example
finalclassMyListextendsAbstractList<String> {
// a false negative of the current ruleprotectedvoididontOverrideAnything() { }
}
changed the title [-][java] Merge rules about protected in final class[/-][+][java] Merge rules about protected in final class (AvoidProtectedFieldInFinalClass, AvoidProtectedMethodInFinalClassNotExtending)[/+]on Aug 20, 2026
a:new-ruleProposal to add a new built-in rulean:enhancementAn improvement on existing features / rulesis:deprecationThe main focus is deprecating public APIs or rules, eg to make them internal, or removing them
Activity
[-][java] Merge rules about protected in final class[/-][+][java] Merge rules about protected in final class (AvoidProtectedFieldInFinalClass, AvoidProtectedMethodInFinalClassNotExtending)[/+][doc] Update release notes for 7.27.0 (#6989)