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:
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user