Skip to content

[java] Part of #4841: Deprecate unnecessary public methods in FieldDeclarationsShouldBeAtStartOfClassRule/CyclomaticComplexityRule/SwitchDensityRule#6671

Merged
adangel merged 2 commits into
pmd:mainfrom
UncleOwen:issue-4814-depracate-three-methods
May 28, 2026

Conversation

@UncleOwen

@UncleOwen UncleOwen commented May 13, 2026

Copy link
Copy Markdown
Member

Describe the PR

This PR deprecates 3 methods I found in #6586:

  • FieldDeclarationsShouldBeAtStartOfClassRule.visit(ASTTypeDeclaration, Object)
  • CyclomaticComplexityRule.visitTypeDecl(ASTTypeDeclaration, Object)
  • SwitchDensityRule.visitSwitchLike(ASTSwitchLike, Object)

There is no need for these methods to be public, so I deprecated them.

This also serves as a prototype for future work on #4814. Completely closing this issue will require a major release, but we can still do a lot, I believe.

Related issues

Ready?

  • [n/a] Added unit tests for fixed bug/feature
  • Passing all unit tests
  • Complete build ./mvnw clean verify passes (checked automatically by github actions)
  • [n/a] Added (in-code) documentation (if needed)

@UncleOwen UncleOwen marked this pull request as draft May 13, 2026 18:39
@UncleOwen UncleOwen force-pushed the issue-4814-depracate-three-methods branch from 3b4cb7e to 509d5ee Compare May 13, 2026 18:41
@pmd-actions-helper

pmd-actions-helper Bot commented May 13, 2026

Copy link
Copy Markdown
Contributor

Documentation Preview

Compared to main:
This changeset changes 0 violations,
introduces 0 new violations, 0 new errors and 0 new configuration errors,
removes 0 violations, 15 errors and 9 configuration errors.
There are 0 changed duplications, 0 new duplications and 0 removed duplications.
There are 0 changed CPD errors, 0 new CPD errors and 0 removed CPD errors.

Regression Tester Report

(comment created at 2026-05-27 12:48:53+00:00 for 39fe4e8)

@UncleOwen UncleOwen marked this pull request as ready for review May 13, 2026 18:57
@UncleOwen UncleOwen force-pushed the issue-4814-depracate-three-methods branch 2 times, most recently from 5061925 to c7ca036 Compare May 14, 2026 00:35
UncleOwen added a commit to UncleOwen/pmd that referenced this pull request May 15, 2026
UncleOwen added a commit to UncleOwen/pmd that referenced this pull request May 15, 2026
@UncleOwen UncleOwen force-pushed the issue-4814-depracate-three-methods branch from 7ff2cd2 to 9096ffa Compare May 15, 2026 18:39
UncleOwen added a commit to UncleOwen/pmd that referenced this pull request May 15, 2026
@UncleOwen UncleOwen force-pushed the issue-4814-depracate-three-methods branch from 9096ffa to df6babd Compare May 15, 2026 18:42
UncleOwen added a commit to UncleOwen/pmd that referenced this pull request May 22, 2026
@UncleOwen UncleOwen force-pushed the issue-4814-depracate-three-methods branch from df6babd to 893b18c Compare May 22, 2026 16:40
@UncleOwen UncleOwen requested a review from adangel May 24, 2026 18:56
@adangel adangel added the is:deprecation The main focus is deprecating public APIs or rules, eg to make them internal, or removing them label May 25, 2026
@adangel adangel changed the title [java] Work on #4814: Deprecate 3 methods [java] Part of #4841: Deprecate unnecessary public methods in some rules May 25, 2026

@adangel adangel left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Can you try to use the {% javadoc macro in the release notes?
Note: I already renamed this PR, you'll need to update the release notes...

Apart from that, the changes look fine.

Comment thread docs/pages/release_notes.md Outdated
Comment thread docs/pages/release_notes.md Outdated
@adangel adangel added this to the 7.25.0 milestone May 25, 2026
@UncleOwen UncleOwen changed the title [java] Part of #4841: Deprecate unnecessary public methods in some rules [java] Part of #4841: Deprecate unnecessary public methods in FieldDeclarationsShouldBeAtStartOfClassRule/CyclomaticComplexityRule/SwitchDensityRule May 25, 2026
@UncleOwen UncleOwen force-pushed the issue-4814-depracate-three-methods branch from fd6d6a1 to 544947b Compare May 25, 2026 17:42
UncleOwen added a commit to UncleOwen/pmd that referenced this pull request May 25, 2026
@UncleOwen UncleOwen force-pushed the issue-4814-depracate-three-methods branch from 544947b to 00281fc Compare May 25, 2026 18:11
FieldDeclarationsShouldBeAtStartOfClassRule.visit(ASTTypeDeclaration, Object)
CyclomaticComplexityRule.visitTypeDecl(ASTTypeDeclaration, Object)
SwitchDensityRule.visitSwitchLike(ASTSwitchLike, Object)

There is no need for these methods to be public, so I deprecated them.

This also serves as a prototype for future work on pmd#4814. Completely
closing this issue will require a major release, but we can still do a
lot, I believe.
UncleOwen added a commit to UncleOwen/pmd that referenced this pull request May 27, 2026
UncleOwen added a commit to UncleOwen/pmd that referenced this pull request May 27, 2026
@UncleOwen UncleOwen force-pushed the issue-4814-depracate-three-methods branch from aed4427 to 39fe4e8 Compare May 27, 2026 12:34
@adangel adangel merged commit f306438 into pmd:main May 28, 2026
13 checks passed
@UncleOwen UncleOwen deleted the issue-4814-depracate-three-methods branch May 28, 2026 07:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

is:deprecation The main focus is deprecating public APIs or rules, eg to make them internal, or removing them

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants