Skip to content

[java] UselessParentheses false positive with boolean operators #1918

@xuanuy

Description

@xuanuy

Affects PMD Version: 3.12.0

Rule: UselessParentheses

Description:
I have the condition if(a || b || (c & d) || e)
Then I get Useless parentheses violation message.

Code Sample demonstrating the issue:

if(a || b || (c & d) || e) {
 //do sth
}

Running PMD through: Maven

Java JDK 8

Metadata

Metadata

Assignees

No one assigned

    Labels

    a:false-positivePMD flags a piece of code that is not problematic

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions