New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[java] False positive "UselessParentheses" for parentheses that contain assignment #1285

Closed
cobratbq opened this Issue Aug 5, 2018 · 0 comments

Comments

Projects
None yet
3 participants
@cobratbq
Contributor

cobratbq commented Aug 5, 2018

Affects PMD Version: PMD 6.5.0, ran through maven-pmd-plugin 3.10.0.

Rule: UselessParentheses (category/java/codestyle.xml/UselessParentheses)

Description: This detector does not detect the value of the extra parentheses to ensure that the right result is assigned to the in-line assignment.

Code Sample demonstrating the issue:

Matcher matcher;
if ((matcher = PATTERN_V4.matcher(message)).matches()) {
    ...
}

Running PMD through: Maven

@cobratbq cobratbq changed the title from [java] False positive "UselessParentheses" for parentheses that include assignment to [java] False positive "UselessParentheses" for parentheses that contain assignment Aug 5, 2018

@adangel adangel added this to the 6.7.0 milestone Aug 7, 2018

@adangel adangel added the has:pr label Aug 7, 2018

@adangel adangel closed this Aug 7, 2018

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