Skip to content

[java] Prepare deprecation of asCtx in java-codestyle (part of #4814) - #6975

Merged
adangel merged 4 commits into
pmd:mainfrom
UncleOwen:issue-4814-java-codestyle
Sep 22, 2026
Merged

adangel merged 4 commits into
pmd:mainfrom
UncleOwen:issue-4814-java-codestyle

Conversation

@UncleOwen

Copy link
Copy Markdown
Member

Describe the PR

Rewrite all rule visitors in java-codestyle to...

  • cast the "Object data" parameter to RuleContext first
  • never touch "data" again
  • return null instead of data

This removes all calls to asCtx() from java-codestyle.

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 August 14, 2026 20:31
@UncleOwen
UncleOwen force-pushed the issue-4814-java-codestyle branch from 1bfadd7 to 7d36e5e Compare August 14, 2026 20:34
@pmd-actions-helper

pmd-actions-helper Bot commented Aug 14, 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, 0 errors and 0 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-09-22 16:19:57+00:00 for 5e66a9b)

Rewrite all rule visitors in java-codestyle to...
* cast the "Object data" parameter to RuleContext first
* never touch "data" again
* return null instead of data
@UncleOwen
UncleOwen force-pushed the issue-4814-java-codestyle branch from 7d36e5e to b251aed Compare August 14, 2026 20:59
@UncleOwen
UncleOwen marked this pull request as ready for review August 14, 2026 21:15
@UncleOwen UncleOwen changed the title [java] Prepare deprecation of asCtx in java-codestyle (part of #4814) - #6919 [java] Prepare deprecation of asCtx in java-codestyle (part of #4814) Aug 15, 2026
UncleOwen and others added 3 commits August 27, 2026 19:38
# Conflicts:
#	pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryCastRule.java
@adangel adangel added the in:pmd-internals Affects PMD's internals label Sep 22, 2026
@adangel adangel added this to the 7.28.0 milestone Sep 22, 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!

@adangel
adangel merged commit e092703 into pmd:main Sep 22, 2026
13 checks passed
@UncleOwen
UncleOwen deleted the issue-4814-java-codestyle branch September 22, 2026 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

in:pmd-internals Affects PMD's internals

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants