[mqtt] Fix most SAT findings (#12492)
Signed-off-by: Wouter Born <github@maindrain.net>
This commit is contained in:
@@ -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.
|
||||
*
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user