Skip to content

Commit

Permalink
Reduce SAT warnings
Browse files Browse the repository at this point in the history
Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
  • Loading branch information
holgerfriedrich committed Jan 11, 2025
1 parent 6dffaa6 commit b4d0983
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ protected boolean remoteEnabled() {
try {
Configuration configuration = configurationAdmin.getConfiguration("org.openhab.addons", null);
Dictionary<String, Object> properties = configuration.getProperties();
if (properties == null) {
if (properties == null) { // NOPMD
// if we can't determine a set property, we use true (default is remote enabled)
return true;
}
Expand All @@ -312,7 +312,7 @@ protected boolean includeIncompatible() {
try {
Configuration configuration = configurationAdmin.getConfiguration("org.openhab.addons", null);
Dictionary<String, Object> properties = configuration.getProperties();
if (properties == null) {
if (properties == null) { // NOPMD
// if we can't determine a set property, we use false (default is show compatible only)
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ public boolean isCompatible(@Nullable AudioFormat audioFormat) {
if (getBitRate() instanceof Integer bitRate && !bitRate.equals(audioFormat.getBitRate())) {
return false;
}
if (getFrequency() instanceof Long frequency && !frequency.equals(audioFormat.getFrequency())) {
if (getFrequency() instanceof Long frequency && !frequency.equals(audioFormat.getFrequency())) { // NOPMD
return false;
}
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -748,7 +748,7 @@ public List<DialogRegistration> getDialogRegistrations() {
}

private boolean checkLocales(Set<Locale> supportedLocales, Locale locale) {
if (supportedLocales.isEmpty()) {
if (supportedLocales.isEmpty()) { // NOPMD
return true;
}
return supportedLocales.stream().anyMatch(sLocale -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public class ThreadedEventHandler implements Closeable {
logger.trace("inspect event: {}", event);
if (event == null) {
logger.debug("Hey, you have really very few events.");
} else if (event.equals(notifyEvent)) {
} else if (event.equals(notifyEvent)) { // NOPMD
// received an internal notification
} else {
worker.handleEvent(event);
Expand Down
8 changes: 1 addition & 7 deletions tools/static-code-analysis/pmd/suppressions.properties
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
org.openhab.core.common.registry.AbstractRegistry=AvoidCatchingThrowable
org.openhab.core.internal.common.SafeCallManagerImpl=CompareObjectsWithEquals
org.openhab.core.internal.events.ThreadedEventHandler=CompareObjectsWithEquals
org.openhab.core.internal.events.ThreadedEventHandler=EmptyIfStmt
org.openhab.core.thing.internal.ChannelItemProvider=CompareObjectsWithEquals
org.openhab.core.thing.internal.ThingManager=CompareObjectsWithEquals
org.openhab.core.io.console.karaf.internal.OSGiConsole=SystemPrintln
org.openhab.core.io.console.rfc147.internal.CommandWrapper=SystemPrintln
org.openhab.core.io.console.rfc147.internal.OSGiConsole=SystemPrintln
org.openhab.core.io.net.http.internal.SecureHttpClientFactory=AvoidThrowingRawExceptionTypes
org.openhab.core.model.core.internal.ModelRepositoryImpl=AvoidCatchingNPE
org.openhab.core.model.script.interpreter.ScriptInterpreter=AvoidCatchingThrowable
org.openhab.core.ui.internal.proxy.ProxyServletService=AvoidCatchingThrowable
org.openhab.core.automation.internal.RuleEngineImpl=AvoidCatchingThrowable
org.openhab.core.automation.internal.RuleRegistryImpl=CompareObjectsWithEquals
org.openhab.core.automation.internal.provider.AutomationResourceBundlesEventQueue=AvoidCatchingThrowable
org.openhab.core.io.console.karaf.internal.InstallServiceCommand=SystemPrintln
org.openhab.core.common.PoolBasedSequentialScheduledExecutorService=CompareObjectsWithEquals
org.openhab.core.tools.UpgradeTool.java=SystemPrintln

0 comments on commit b4d0983

Please sign in to comment.