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] Fix #6075: Fix FP in AssignmentInOperandRule by UncleOwen · Pull Request #6078 · pmd/pmd

Conversation

@UncleOwen

@UncleOwen UncleOwen commented Sep 19, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Describe the PR

When fixing #3434, I missed the case of assignments inside a lambda. This fixes that.

Related issues

  • Fix [java] AssignmentInOperand false positive with lambda expressions #6075

Question

I don't understand what || it instanceof ASTArgumentList && it.getParent() instanceof ASTExpression) (JavaAstUtils.getTopLevelExpr) is doing and if I need to change that, too. Could someone explain that to me? If I remove that part, the test suite is still green, so maybe that's dead code? Regression Test Report looks identical, too.

Ready?

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@UncleOwen
UncleOwen marked this pull request as draft September 19, 2025 20:50
@pmd-actions-helper

pmd-actions-helper Bot commented Sep 19, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Documentation Preview

No regression tested rules have been changed.

(comment created at 2025-09-25 15:44:00+00:00 for 4ba5524)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@UncleOwen
UncleOwen force-pushed the issue-6075-AssignmentInOperand-false-positive branch from 65e99c4 to 13f08c1 Compare September 20, 2025 14:43
@UncleOwen

UncleOwen commented Sep 20, 2025

Copy link
Copy Markdown
Member Author

Ok, now I get it: An ASTArgumentList is part of a function call, not part of the function signature.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@UncleOwen
UncleOwen marked this pull request as ready for review September 20, 2025 15:18
adangel
adangel approved these changes Sep 25, 2025
View reviewed changes

@adangel adangel left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Thanks!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
adangel added a commit to UncleOwen/pmd that referenced this pull request Sep 25, 2025
@adangel
[doc] Update release notes (pmd#6075, pmd#6078)
aadac20
UncleOwen and others added 4 commits September 25, 2025 17:24
@UncleOwen @adangel
Fix FP in AssignmentInOperandRule
d65a698
@UncleOwen @adangel
Add some tests for JavaAstUtils.getTopLevelExpr()
d2b658a
@adangel
[doc] Update release notes (pmd#6075, pmd#6078)
fbf33bc
@adangel
Add @vzorge as a contributor
4ba5524
@adangel
adangel force-pushed the issue-6075-AssignmentInOperand-false-positive branch from 65bd9fd to 4ba5524 Compare September 25, 2025 15:27
@adangel adangel added this to the 7.18.0 milestone Sep 25, 2025
@adangel
adangel merged commit 31cdcfa into pmd:main Sep 25, 2025
@UncleOwen
UncleOwen deleted the issue-6075-AssignmentInOperand-false-positive branch September 25, 2025 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@adangel adangel adangel approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

7.18.0

Development

Successfully merging this pull request may close these issues.

[java] AssignmentInOperand false positive with lambda expressions

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@UncleOwen @adangel
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.