pmd: fix #1111 False positive: Useless parentheses

This commit is contained in:
Andreas Dangel 2013-08-03 17:13:38 +02:00
parent 829a939421
commit dc64e2df77
3 changed files with 11 additions and 1 deletions

View File

@ -1,6 +1,7 @@
????? ??, 2013 - 5.0.5:
Fixed bug 991: AvoidSynchronizedAtMethodLevel for static methods
Fixed bug 1111: False positive: Useless parentheses
Fixed bug 1114: CPD - Tokenizer not initialized with requested properties
Fixed bug 1118: ClassCastException in pmd.lang.ecmascript.ast.ASTElementGet

View File

@ -220,7 +220,7 @@ public class Test {
<property name="xpath">
<value>
<![CDATA[
//Expression/PrimaryExpression/PrimaryPrefix/Expression[count(*)=1 and count(./CastExpression)=0]
//Expression/PrimaryExpression/PrimaryPrefix/Expression[count(*)=1 and count(./CastExpression)=0 and count(./ConditionalExpression[@Ternary='true'])=0]
|
//Expression/ConditionalAndExpression/PrimaryExpression/PrimaryPrefix/Expression[
count(*)=1 and

View File

@ -196,4 +196,13 @@ public class Test {
}
]]></code>
</test-code>
<test-code>
<description>#1111 False positive: Useless parentheses</description>
<expected-problems>0</expected-problems>
<code><![CDATA[
public class Test { public String check() {
return (absolute ? amount.abs() : amount).toString();
} }
]]></code>
</test-code>
</test-data>