src/main/java/de/uniks/networkparser/logic/IdFilterElements.java
These nested if statements could be combined Open
Open
if (condition.update(evt)) {
return add(((PropertyChangeEvent) evt).getNewValue());
}
- Read upRead up
- Exclude checks
CollapsibleIfStatements
Since: PMD 3.1
Priority: Medium
Categories: Style
Remediation Points: 50000
Sometimes two consecutive 'if' statements can be consolidated by separating their conditions with a boolean short-circuit operator.
Example:
void bar() {
if (x) { // original implementation
if (y) {
// do stuff
}
}
}
void bar() {
if (x && y) { // optimized implementation
// do stuff
}
}