[java] SimplifiedTernary: False positive with ternary operator
A source code analyzer
Brought to you by:
adangel,
juansotuyo
False positive, not a false negative. I've seen this one too.
The XPath query matches any BooleanLiteral in the ternary subtrees - it should match just the literals directly (full AST path to literal): https://pmd.github.io/pmd-5.4.0/pmd-java/rules/java/basic.html#SimplifiedTernary
This bug will be fixed with PMD 5.4.2 and later.
Commit: https://github.com/pmd/pmd/commit/cfaaf2f52ae791ed02347c1b8dbb1aa859435510