Fix SAT warnings (#14202)

* Fix SAT warnings

- checkstyle.ModifierOrderCheck
- checkstyle.OneStatementPerLineCheck
- checkstyle.NeedBracesCheck
- PMD.UseStandardCharsets
- PMD.UseCollectionIsEmpty
- PMD.UnusedLocalVariable
- PMD.SimplifyBooleanReturns where reasonable, suppress where
readability is better without change
- PMD.SimplifyBooleanExpressions

* Include StandardCharsets

Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
This commit is contained in:
Holger Friedrich
2023-01-13 08:11:06 +01:00
committed by GitHub
parent 6aa0dcbc70
commit 4e44de3894
86 changed files with 148 additions and 157 deletions

View File

@@ -113,11 +113,7 @@ public class DigiplexResponseResolver {
}
private static boolean toBoolean(char value) {
if (value == 'O') {
return false;
} else {
return true;
}
return value != 'O';
}
private static DigiplexResponse resolveSystemEvent(String message) {

View File

@@ -41,9 +41,6 @@ public abstract class AbstractEvent implements DigiplexResponse {
// TODO: According to documentation: areaNo = 255 - Occurs in at least one area enabled in the system.
// I did never encounter 255 on my system though (EVO192).
// 15 is returned instead, which (I believe) has the same meaning.
if (this.areaNo == 15 || this.areaNo == 255) {
return true;
}
return false;
return (this.areaNo == 15 || this.areaNo == 255);
}
}

View File

@@ -101,11 +101,7 @@ public class DigiplexDiscoveryService extends AbstractDiscoveryService
private boolean isDefaultName(ZoneLabelResponse response) {
return ZONE_DEFAULT_NAMES.stream().anyMatch(format -> {
if (String.format(format, response.zoneNo).equals(response.zoneName)) {
return true;
} else {
return false;
}
return String.format(format, response.zoneNo).equals(response.zoneName);
});
}