Skip to content

[java] Fix #1050: NullAssignment false positive inside if statement for first assignment - #7035

Merged
UncleOwen merged 3 commits into
pmd:mainfrom
lukasgraef:issue1050
Sep 14, 2026
Merged

UncleOwen merged 3 commits into
pmd:mainfrom
lukasgraef:issue1050

Conversation

@lukasgraef

@lukasgraef lukasgraef commented Sep 6, 2026 •

Copy link
Copy Markdown
Member

Describe the PR

Related issues

Ready?

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

@pmd-actions-helper

pmd-actions-helper Bot commented Sep 6, 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 72 violations, 16 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-09-12 10:36:00+00:00 for 1e0991c)

@lukasgraef
lukasgraef marked this pull request as ready for review September 6, 2026 12:40
@UncleOwen

Copy link
Copy Markdown
Member

The regression tester shows 2 new errors. What's up with that?

@zbynek

zbynek commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Btw. there is another issue for deprecating this rule: #3714

I think this PR is an improvement and could be merged even if the rule gets deprecated later, but if it's hard to fix the errors, maybe the deprecation would be easier.

@lukasgraef

lukasgraef commented Sep 7, 2026 •

Copy link
Copy Markdown
Member Author

I have fixed the regression tester errors.
I somehow completely missed those...

As for deprecating this rule: Is there any consensus yet?

@UncleOwen UncleOwen added this to the 7.28.0 milestone Sep 14, 2026

@UncleOwen UncleOwen 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!

@UncleOwen
UncleOwen merged commit 35aef60 into pmd:main Sep 14, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[java] NullAssignment: False positive inside if statement for first assignment

3 participants