[infrastructure] move infered nullness warnings to error and update EEA (#8949)
Signed-off-by: Jan N. Klug <jan.n.klug@rub.de>
This commit is contained in:
@@ -14,6 +14,7 @@ package org.openhab.binding.mqtt.homeassistant.internal;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.eclipse.jdt.annotation.NonNullByDefault;
|
||||
@@ -54,7 +55,7 @@ public abstract class BaseChannelConfiguration {
|
||||
*/
|
||||
public static <C extends BaseChannelConfiguration> C fromString(final String configJSON, final Gson gson,
|
||||
final Class<C> clazz) {
|
||||
return gson.fromJson(configJSON, clazz);
|
||||
return Objects.requireNonNull(gson.fromJson(configJSON, clazz));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -69,10 +69,7 @@ public class ChannelConfigurationTypeAdapterFactory implements TypeAdapterFactor
|
||||
|
||||
return new TypeAdapter<T>() {
|
||||
@Override
|
||||
public T read(@Nullable JsonReader in) throws IOException {
|
||||
if (in == null) {
|
||||
return null;
|
||||
}
|
||||
public @Nullable T read(JsonReader in) throws IOException {
|
||||
/* read the object using the default adapter, but translate the names in the reader */
|
||||
T result = delegate.read(MappingJsonReader.getConfigMapper(in));
|
||||
/* do the '~' expansion afterwards */
|
||||
@@ -81,7 +78,7 @@ public class ChannelConfigurationTypeAdapterFactory implements TypeAdapterFactor
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(@Nullable JsonWriter out, T value) throws IOException {
|
||||
public void write(JsonWriter out, @Nullable T value) throws IOException {
|
||||
delegate.write(out, value);
|
||||
}
|
||||
};
|
||||
@@ -93,17 +90,14 @@ public class ChannelConfigurationTypeAdapterFactory implements TypeAdapterFactor
|
||||
|
||||
return new TypeAdapter<T>() {
|
||||
@Override
|
||||
public T read(@Nullable JsonReader in) throws IOException {
|
||||
if (in == null) {
|
||||
return null;
|
||||
}
|
||||
public @Nullable T read(JsonReader in) throws IOException {
|
||||
/* read the object using the default adapter, but translate the names in the reader */
|
||||
T result = delegate.read(MappingJsonReader.getDeviceMapper(in));
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(@Nullable JsonWriter out, T value) throws IOException {
|
||||
public void write(JsonWriter out, @Nullable T value) throws IOException {
|
||||
delegate.write(out, value);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user