[mqtt] Fix most SAT findings (#12492)

Signed-off-by: Wouter Born <github@maindrain.net>
This commit is contained in:
Wouter Born
2022-03-19 09:27:41 +01:00
committed by GitHub
parent af8202e668
commit a6f5b48dd5
60 changed files with 490 additions and 481 deletions

View File

@@ -24,8 +24,6 @@ import org.openhab.binding.mqtt.homeassistant.internal.config.dto.AbstractChanne
import org.openhab.binding.mqtt.homeassistant.internal.exception.ConfigurationException;
import org.openhab.binding.mqtt.homeassistant.internal.exception.UnsupportedComponentException;
import org.openhab.core.thing.ThingUID;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.gson.Gson;
@@ -37,8 +35,6 @@ import com.google.gson.Gson;
*/
@NonNullByDefault
public class ComponentFactory {
private static final Logger LOGGER = LoggerFactory.getLogger(ComponentFactory.class);
/**
* Create a HA MQTT component. The configuration JSon string is required.
*

View File

@@ -154,7 +154,7 @@ public class ChannelConfigurationTypeAdapterFactory implements TypeAdapterFactor
field.set(config, newValue);
} catch (IllegalArgumentException | IllegalAccessException e) {
throw new RuntimeException(e);
throw new IllegalStateException(e);
}
}
}

View File

@@ -12,11 +12,14 @@
*/
package org.openhab.binding.mqtt.homeassistant.internal.exception;
import org.eclipse.jdt.annotation.NonNullByDefault;
/**
* Exception class for errors in HomeAssistant components configurations
*
* @author Anton Kharuzhy - Initial contribution
*/
@NonNullByDefault
public class ConfigurationException extends RuntimeException {
public ConfigurationException(String message) {
super(message);

View File

@@ -12,11 +12,14 @@
*/
package org.openhab.binding.mqtt.homeassistant.internal.exception;
import org.eclipse.jdt.annotation.NonNullByDefault;
/**
* Exception class for unsupported components
*
* @author Anton Kharuzhy - Initial contribution
*/
@NonNullByDefault
public class UnsupportedComponentException extends ConfigurationException {
public UnsupportedComponentException(String message) {
super(message);