Enable PMD rule SimplifiedTernary and fix violations

This commit is contained in:
Manuel Fuhr 2022-11-13 15:49:33 +01:00
parent a07fc132d2
commit 09a9c1a104
3 changed files with 2 additions and 3 deletions

View file

@ -309,7 +309,7 @@ public class RoutingEngine extends Thread {
}
if (hasInfo()) {
boolean found = nearbyTrack != null;
boolean dirty = found ? nearbyTrack.isDirty : false;
boolean dirty = found && nearbyTrack.isDirty;
logInfo("read referenceTrack, found=" + found + " dirty=" + dirty + " " + debugInfo);
}
}

View file

@ -882,7 +882,7 @@ public abstract class BExpressionContext implements IByteArrayUnifier {
}
public final boolean isLookupIdxUsed(int idx) {
return idx < lookupIdxUsed.length ? lookupIdxUsed[idx] : false;
return idx < lookupIdxUsed.length && lookupIdxUsed[idx];
}
public final void setAllTagsUsed() {

View file

@ -32,7 +32,6 @@
<exclude name="PrimitiveWrapperInstantiation" />
<exclude name="ReturnEmptyCollectionRatherThanNull" />
<exclude name="SimplifiableTestAssertion" />
<exclude name="SimplifiedTernary" />
<exclude name="SimplifyBooleanReturns" />
<exclude name="UncommentedEmptyConstructor" />
<exclude name="UncommentedEmptyMethodBody" />