Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Static code analysis using PMD #483

Merged
merged 12 commits into from
Nov 23, 2022
Merged
Prev Previous commit
Next Next commit
Enable PMD rule SimplifyBooleanReturns and fix violations
  • Loading branch information
zod committed Nov 14, 2022
commit 41d25cd5239fb7a48a98764b99555186a79a9c4a
5 changes: 1 addition & 4 deletions brouter-util/src/main/java/btools/util/CompactLongSet.java
Original file line number Diff line number Diff line change
@@ -141,10 +141,7 @@ private boolean contains(int idx, long id) {
n = nn;
}
}
if (a[n] == id) {
return true;
}
return false;
return a[n] == id;
}

protected void moveToFrozenArray(long[] faid) {
5 changes: 1 addition & 4 deletions brouter-util/src/main/java/btools/util/FrozenLongSet.java
Original file line number Diff line number Diff line change
@@ -61,10 +61,7 @@ public boolean contains(long id) {
}
offset >>= 1;
}
if (a[n] == id) {
return true;
}
return false;
return a[n] == id;
}

}
1 change: 0 additions & 1 deletion config/pmd/pmd-ruleset.xml
Original file line number Diff line number Diff line change
@@ -31,7 +31,6 @@
<exclude name="PreserveStackTrace" />
<exclude name="PrimitiveWrapperInstantiation" />
<exclude name="ReturnEmptyCollectionRatherThanNull" />
<exclude name="SimplifyBooleanReturns" />
<exclude name="UncommentedEmptyConstructor" />
<exclude name="UncommentedEmptyMethodBody" />
<exclude name="UnusedFormalParameter" />