GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [java] Merge rules about protected in final class (AvoidProtectedFieldInFinalClass, AvoidProtectedMethodInFinalClassNotExtending) · Issue #2974 · pmd/pmd

[java] Merge rules about protected in final class (AvoidProtectedFieldInFinalClass, AvoidProtectedMethodInFinalClassNotExtending) #2974

New issue
Copy link
New issue
Copy link
Closed
#6964
Closed
[java] Merge rules about protected in final class (AvoidProtectedFieldInFinalClass, AvoidProtectedMethodInFinalClassNotExtending)#2974
#6964
Copy link
Labels
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
Milestone
7.27.0

Description

@oowekyala
oowekyala
opened on Dec 14, 2020
Issue body actions

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

final class MyList extends AbstractList<String> {

    // a false negative of the current rule
    protected void idontOverrideAnything() { }

}
Reacted by Zbynek Konecny

Activity

  1. oowekyala
    added
    an:enhancementAn improvement on existing features / rules
    a:new-ruleProposal to add a new built-in rule
    on Dec 14, 2020
  2. oowekyala
    added this to the 7.0.0 milestone on Dec 14, 2020
  3. adangel
    modified the milestones: 7.0.0, 7.x on Jan 23, 2023
  4. UncleOwen
    closed this as completedin #6964on Aug 19, 2026
  5. UncleOwen
    modified the milestones: 7.x, 7.27.0 on Aug 19, 2026
  6. adangel
    added
    is:deprecationThe main focus is deprecating public APIs or rules, eg to make them internal, or removing them
    on Aug 20, 2026
  7. adangel
    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
  8. UncleOwen
    added a commit that references this issue on Aug 20, 2026

    [doc] Update release notes for 7.27.0 (#6989)

    8c7c981
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    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

    Type

    No type

    Projects

    No projects

      Milestone

      • 7.27.0

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.