Fix TODO - false positive of UselessParenthesis (refs #709)

This commit is contained in:
Andreas Dangel
2017-11-03 20:09:16 +01:00
parent c466179c2a
commit 17f2e793d7
2 changed files with 11 additions and 2 deletions

View File

@ -120,8 +120,6 @@ public abstract class AbstractJavaAccessNode extends AbstractJavaNode implements
setModifier(isDefault, DEFAULT);
}
// TODO: fix the rule - around binary expressions the parentheses are needed...
@SuppressWarnings("PMD.UselessParentheses")
private boolean isModifier(int mask) {
return (modifiers & mask) == mask;
}

View File

@ -460,4 +460,15 @@ public class Useless {
]]></code>
</test-code>
<test-code>
<description>FP on binary operator</description>
<expected-problems>0</expected-problems>
<code><![CDATA[
public class Foo {
private boolean isModifier(int mask) {
return (modifiers & mask) == mask;
}
}
]]></code>
</test-code>
</test-data>