#1366 UselessParentheses false positive on multiple equality operators

This commit is contained in:
Andreas Dangel
2015-06-01 20:06:01 +02:00
parent 66c1191984
commit d28e4f1fb5
3 changed files with 14 additions and 1 deletions

View File

@ -253,7 +253,8 @@ public class Test {
count(./InclusiveOrExpression)=0 and
count(./ExclusiveOrExpression)=0 and
count(./ConditionalAndExpression)=0 and
count(./ConditionalOrExpression)=0]
count(./ConditionalOrExpression)=0 and
count(./EqualityExpression)=0]
]]>
</value>
</property>

View File

@ -240,6 +240,17 @@ public class NewClass {
public void falsePositive(Boolean b) throws IOException {
System.out.write(( "" + b ).getBytes());
}
}
]]></code>
</test-code>
<test-code>
<description>#1366 UselessParentheses false positive on multiple equality operators</description>
<expected-problems>0</expected-problems>
<code><![CDATA[
public class Useless {
public boolean test(Object a, Object b) {
return (a == null) == (b == null);
}
}
]]></code>
</test-code>

View File

@ -14,5 +14,6 @@
* [#1364](https://sourceforge.net/p/pmd/bugs/1364/): FieldDeclarationsShouldBeAtStartOfClass false positive using multiple annotations
* [#1365](https://sourceforge.net/p/pmd/bugs/1365/): Aggregated javadoc report is missing
* [#1366](https://sourceforge.net/p/pmd/bugs/1366/): UselessParentheses false positive on multiple equality operators
**API Changes:**