Remove Map null annotation workarounds (#8916)
These workarounds to prevent false positives can be removed now the EEAs allow for proper null analysis. Signed-off-by: Wouter Born <github@maindrain.net>
This commit is contained in:
@@ -249,8 +249,7 @@ public class InsteonBinding {
|
||||
handler.updateState(channelUID, state);
|
||||
}
|
||||
|
||||
public InsteonDevice makeNewDevice(InsteonAddress addr, String productKey,
|
||||
Map<String, @Nullable Object> deviceConfigMap) {
|
||||
public InsteonDevice makeNewDevice(InsteonAddress addr, String productKey, Map<String, Object> deviceConfigMap) {
|
||||
DeviceType dt = DeviceTypeLoader.instance().getDeviceType(productKey);
|
||||
InsteonDevice dev = InsteonDevice.makeDevice(dt);
|
||||
dev.setAddress(addr);
|
||||
@@ -296,7 +295,7 @@ public class InsteonBinding {
|
||||
private int checkIfInModemDatabase(InsteonDevice dev) {
|
||||
try {
|
||||
InsteonAddress addr = dev.getAddress();
|
||||
Map<InsteonAddress, @Nullable ModemDBEntry> dbes = driver.lockModemDBEntries();
|
||||
Map<InsteonAddress, ModemDBEntry> dbes = driver.lockModemDBEntries();
|
||||
if (dbes.containsKey(addr)) {
|
||||
if (!dev.hasModemDBEntry()) {
|
||||
logger.debug("device {} found in the modem database and {}.", addr, getLinkInfo(dbes, addr, true));
|
||||
@@ -316,7 +315,7 @@ public class InsteonBinding {
|
||||
public Map<String, String> getDatabaseInfo() {
|
||||
try {
|
||||
Map<String, String> databaseInfo = new HashMap<>();
|
||||
Map<InsteonAddress, @Nullable ModemDBEntry> dbes = driver.lockModemDBEntries();
|
||||
Map<InsteonAddress, ModemDBEntry> dbes = driver.lockModemDBEntries();
|
||||
for (InsteonAddress addr : dbes.keySet()) {
|
||||
String a = addr.toString();
|
||||
databaseInfo.put(a, a + ": " + getLinkInfo(dbes, addr, false));
|
||||
@@ -360,7 +359,7 @@ public class InsteonBinding {
|
||||
return (dev);
|
||||
}
|
||||
|
||||
private String getLinkInfo(Map<InsteonAddress, @Nullable ModemDBEntry> dbes, InsteonAddress a, boolean prefix) {
|
||||
private String getLinkInfo(Map<InsteonAddress, ModemDBEntry> dbes, InsteonAddress a, boolean prefix) {
|
||||
ModemDBEntry dbe = dbes.get(a);
|
||||
List<Byte> controls = dbe.getControls();
|
||||
List<Byte> responds = dbe.getRespondsTo();
|
||||
@@ -454,7 +453,7 @@ public class InsteonBinding {
|
||||
public void driverCompletelyInitialized() {
|
||||
List<String> missing = new ArrayList<>();
|
||||
try {
|
||||
Map<InsteonAddress, @Nullable ModemDBEntry> dbes = driver.lockModemDBEntries();
|
||||
Map<InsteonAddress, ModemDBEntry> dbes = driver.lockModemDBEntries();
|
||||
logger.debug("modem database has {} entries!", dbes.size());
|
||||
if (dbes.isEmpty()) {
|
||||
logger.warn("the modem link database is empty!");
|
||||
|
||||
@@ -53,8 +53,8 @@ public class InsteonHandlerFactory extends BaseThingHandlerFactory {
|
||||
private static final Set<ThingTypeUID> SUPPORTED_THING_TYPES_UIDS = Collections
|
||||
.unmodifiableSet(Stream.of(DEVICE_THING_TYPE, NETWORK_THING_TYPE).collect(Collectors.toSet()));
|
||||
|
||||
private final Map<ThingUID, @Nullable ServiceRegistration<?>> discoveryServiceRegs = new HashMap<>();
|
||||
private final Map<ThingUID, @Nullable ServiceRegistration<?>> serviceRegs = new HashMap<>();
|
||||
private final Map<ThingUID, ServiceRegistration<?>> discoveryServiceRegs = new HashMap<>();
|
||||
private final Map<ThingUID, ServiceRegistration<?>> serviceRegs = new HashMap<>();
|
||||
|
||||
private @Nullable SerialPortManager serialPortManager;
|
||||
|
||||
|
||||
@@ -15,7 +15,6 @@ package org.openhab.binding.insteon.internal.config;
|
||||
import java.util.Map;
|
||||
|
||||
import org.eclipse.jdt.annotation.NonNullByDefault;
|
||||
import org.eclipse.jdt.annotation.Nullable;
|
||||
import org.openhab.binding.insteon.internal.device.InsteonAddress;
|
||||
import org.openhab.core.thing.ChannelUID;
|
||||
|
||||
@@ -33,10 +32,10 @@ public class InsteonChannelConfiguration {
|
||||
private final InsteonAddress address;
|
||||
private final String feature;
|
||||
private final String productKey;
|
||||
private final Map<String, @Nullable String> parameters;
|
||||
private final Map<String, String> parameters;
|
||||
|
||||
public InsteonChannelConfiguration(ChannelUID channelUID, String feature, InsteonAddress address, String productKey,
|
||||
Map<String, @Nullable String> parameters) {
|
||||
Map<String, String> parameters) {
|
||||
this.channelUID = channelUID;
|
||||
this.feature = feature;
|
||||
this.address = address;
|
||||
@@ -66,7 +65,7 @@ public class InsteonChannelConfiguration {
|
||||
return productKey;
|
||||
}
|
||||
|
||||
public Map<String, @Nullable String> getParameters() {
|
||||
public Map<String, String> getParameters() {
|
||||
return parameters;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ public abstract class CommandHandler {
|
||||
private static final Logger logger = LoggerFactory.getLogger(CommandHandler.class);
|
||||
DeviceFeature feature; // related DeviceFeature
|
||||
@Nullable
|
||||
Map<String, @Nullable String> parameters = new HashMap<>();
|
||||
Map<String, String> parameters = new HashMap<>();
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
@@ -113,7 +113,7 @@ public abstract class CommandHandler {
|
||||
}
|
||||
|
||||
protected int getMaxLightLevel(InsteonChannelConfiguration conf, int defaultLevel) {
|
||||
Map<String, @Nullable String> params = conf.getParameters();
|
||||
Map<String, String> params = conf.getParameters();
|
||||
if (conf.getFeature().contains("dimmer") && params.containsKey("dimmermax")) {
|
||||
String item = conf.getChannelName();
|
||||
String dimmerMax = params.get("dimmermax");
|
||||
@@ -136,7 +136,7 @@ public abstract class CommandHandler {
|
||||
return defaultLevel;
|
||||
}
|
||||
|
||||
void setParameters(Map<String, @Nullable String> map) {
|
||||
void setParameters(Map<String, String> map) {
|
||||
parameters = map;
|
||||
}
|
||||
|
||||
@@ -597,7 +597,7 @@ public abstract class CommandHandler {
|
||||
}
|
||||
|
||||
@Override
|
||||
void setParameters(Map<String, @Nullable String> params) {
|
||||
void setParameters(Map<String, String> params) {
|
||||
super.setParameters(params);
|
||||
onCmd = (byte) getIntParameter("on", 0x2E);
|
||||
offCmd = (byte) getIntParameter("off", 0x2F);
|
||||
@@ -877,8 +877,7 @@ public abstract class CommandHandler {
|
||||
* @return the handler which was created
|
||||
*/
|
||||
@Nullable
|
||||
public static <T extends CommandHandler> T makeHandler(String name, Map<String, @Nullable String> params,
|
||||
DeviceFeature f) {
|
||||
public static <T extends CommandHandler> T makeHandler(String name, Map<String, String> params, DeviceFeature f) {
|
||||
String cname = CommandHandler.class.getName() + "$" + name;
|
||||
try {
|
||||
Class<?> c = Class.forName(cname);
|
||||
|
||||
@@ -18,7 +18,6 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.eclipse.jdt.annotation.NonNullByDefault;
|
||||
import org.eclipse.jdt.annotation.Nullable;
|
||||
import org.openhab.binding.insteon.internal.InsteonBinding;
|
||||
import org.openhab.core.library.types.OnOffType;
|
||||
import org.openhab.core.library.types.PercentType;
|
||||
@@ -46,8 +45,8 @@ public class DeviceFeatureListener {
|
||||
|
||||
private String itemName;
|
||||
private ChannelUID channelUID;
|
||||
private Map<String, @Nullable String> parameters = new HashMap<>();
|
||||
private Map<Class<?>, @Nullable State> state = new HashMap<>();
|
||||
private Map<String, String> parameters = new HashMap<>();
|
||||
private Map<Class<?>, State> state = new HashMap<>();
|
||||
private List<InsteonAddress> relatedDevices = new ArrayList<>();
|
||||
private InsteonBinding binding;
|
||||
private static final int TIME_DELAY_POLL_RELATED_MSEC = 5000;
|
||||
@@ -91,7 +90,7 @@ public class DeviceFeatureListener {
|
||||
*
|
||||
* @param p the parameters to set
|
||||
*/
|
||||
public void setParameters(Map<String, @Nullable String> p) {
|
||||
public void setParameters(Map<String, String> p) {
|
||||
parameters = p;
|
||||
updateRelatedDevices();
|
||||
}
|
||||
|
||||
@@ -24,7 +24,6 @@ import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
|
||||
import org.eclipse.jdt.annotation.NonNullByDefault;
|
||||
import org.eclipse.jdt.annotation.Nullable;
|
||||
import org.openhab.binding.insteon.internal.utils.Utils;
|
||||
import org.openhab.binding.insteon.internal.utils.Utils.ParsingException;
|
||||
import org.openhab.core.library.types.DecimalType;
|
||||
@@ -111,7 +110,7 @@ public class FeatureTemplateLoader {
|
||||
}
|
||||
|
||||
NamedNodeMap attributes = e.getAttributes();
|
||||
Map<String, @Nullable String> params = new HashMap<>();
|
||||
Map<String, String> params = new HashMap<>();
|
||||
for (int i = 0; i < attributes.getLength(); i++) {
|
||||
Node n = attributes.item(i);
|
||||
params.put(n.getNodeName(), n.getNodeValue());
|
||||
|
||||
@@ -15,7 +15,6 @@ package org.openhab.binding.insteon.internal.device;
|
||||
import java.util.Map;
|
||||
|
||||
import org.eclipse.jdt.annotation.NonNullByDefault;
|
||||
import org.eclipse.jdt.annotation.Nullable;
|
||||
|
||||
/**
|
||||
* Ugly little helper class to facilitate late instantiation of handlers
|
||||
@@ -25,15 +24,15 @@ import org.eclipse.jdt.annotation.Nullable;
|
||||
*/
|
||||
@NonNullByDefault
|
||||
public class HandlerEntry {
|
||||
Map<String, @Nullable String> params;
|
||||
Map<String, String> params;
|
||||
String name;
|
||||
|
||||
HandlerEntry(String name, Map<String, @Nullable String> params) {
|
||||
HandlerEntry(String name, Map<String, String> params) {
|
||||
this.name = name;
|
||||
this.params = params;
|
||||
}
|
||||
|
||||
Map<String, @Nullable String> getParams() {
|
||||
Map<String, String> getParams() {
|
||||
return params;
|
||||
}
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ public class InsteonDevice {
|
||||
private InsteonAddress address = new InsteonAddress();
|
||||
private long pollInterval = -1L; // in milliseconds
|
||||
private @Nullable Driver driver = null;
|
||||
private HashMap<String, @Nullable DeviceFeature> features = new HashMap<>();
|
||||
private Map<String, DeviceFeature> features = new HashMap<>();
|
||||
private @Nullable String productKey = null;
|
||||
private volatile long lastTimePolled = 0L;
|
||||
private volatile long lastMsgReceived = 0L;
|
||||
@@ -73,8 +73,8 @@ public class InsteonDevice {
|
||||
private long lastQueryTime = 0L;
|
||||
private boolean hasModemDBEntry = false;
|
||||
private DeviceStatus status = DeviceStatus.INITIALIZED;
|
||||
private Map<Integer, @Nullable GroupMessageStateMachine> groupState = new HashMap<>();
|
||||
private Map<String, @Nullable Object> deviceConfigMap = new HashMap<String, @Nullable Object>();
|
||||
private Map<Integer, GroupMessageStateMachine> groupState = new HashMap<>();
|
||||
private Map<String, Object> deviceConfigMap = new HashMap<String, Object>();
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
@@ -121,7 +121,7 @@ public class InsteonDevice {
|
||||
return features.get(f);
|
||||
}
|
||||
|
||||
public HashMap<String, @Nullable DeviceFeature> getFeatures() {
|
||||
public Map<String, DeviceFeature> getFeatures() {
|
||||
return features;
|
||||
}
|
||||
|
||||
@@ -194,11 +194,11 @@ public class InsteonDevice {
|
||||
}
|
||||
}
|
||||
|
||||
public void setDeviceConfigMap(Map<String, @Nullable Object> deviceConfigMap) {
|
||||
public void setDeviceConfigMap(Map<String, Object> deviceConfigMap) {
|
||||
this.deviceConfigMap = deviceConfigMap;
|
||||
}
|
||||
|
||||
public Map<String, @Nullable Object> getDeviceConfigMap() {
|
||||
public Map<String, Object> getDeviceConfigMap() {
|
||||
return deviceConfigMap;
|
||||
}
|
||||
|
||||
@@ -217,7 +217,7 @@ public class InsteonDevice {
|
||||
public boolean removeFeatureListener(String aItemName) {
|
||||
boolean removedListener = false;
|
||||
synchronized (features) {
|
||||
for (Iterator<Entry<String, @Nullable DeviceFeature>> it = features.entrySet().iterator(); it.hasNext();) {
|
||||
for (Iterator<Entry<String, DeviceFeature>> it = features.entrySet().iterator(); it.hasNext();) {
|
||||
DeviceFeature f = it.next().getValue();
|
||||
if (f.removeListener(aItemName)) {
|
||||
removedListener = true;
|
||||
@@ -584,7 +584,7 @@ public class InsteonDevice {
|
||||
@Override
|
||||
public String toString() {
|
||||
String s = address.toString();
|
||||
for (Entry<String, @Nullable DeviceFeature> f : features.entrySet()) {
|
||||
for (Entry<String, DeviceFeature> f : features.entrySet()) {
|
||||
s += "|" + f.getKey() + "->" + f.getValue().toString();
|
||||
}
|
||||
return s;
|
||||
|
||||
@@ -37,7 +37,7 @@ public abstract class MessageDispatcher {
|
||||
|
||||
DeviceFeature feature;
|
||||
@Nullable
|
||||
Map<String, @Nullable String> parameters = new HashMap<>();
|
||||
Map<String, String> parameters = new HashMap<>();
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
@@ -48,7 +48,7 @@ public abstract class MessageDispatcher {
|
||||
feature = f;
|
||||
}
|
||||
|
||||
public void setParameters(@Nullable Map<String, @Nullable String> map) {
|
||||
public void setParameters(@Nullable Map<String, String> map) {
|
||||
parameters = map;
|
||||
}
|
||||
|
||||
@@ -397,8 +397,8 @@ public abstract class MessageDispatcher {
|
||||
* @return the handler which was created
|
||||
*/
|
||||
@Nullable
|
||||
public static <T extends MessageDispatcher> T makeHandler(String name,
|
||||
@Nullable Map<String, @Nullable String> params, DeviceFeature f) {
|
||||
public static <T extends MessageDispatcher> T makeHandler(String name, @Nullable Map<String, String> params,
|
||||
DeviceFeature f) {
|
||||
String cname = MessageDispatcher.class.getName() + "$" + name;
|
||||
try {
|
||||
Class<?> c = Class.forName(cname);
|
||||
|
||||
@@ -55,7 +55,7 @@ public abstract class MessageHandler {
|
||||
private static final Logger logger = LoggerFactory.getLogger(MessageHandler.class);
|
||||
|
||||
protected DeviceFeature feature;
|
||||
protected Map<String, @Nullable String> parameters = new HashMap<>();
|
||||
protected Map<String, String> parameters = new HashMap<>();
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
@@ -324,7 +324,7 @@ public abstract class MessageHandler {
|
||||
*
|
||||
* @param map the parameter map for this message handler
|
||||
*/
|
||||
public void setParameters(Map<String, @Nullable String> map) {
|
||||
public void setParameters(Map<String, String> map) {
|
||||
parameters = map;
|
||||
}
|
||||
|
||||
@@ -457,7 +457,7 @@ public abstract class MessageHandler {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setParameters(Map<String, @Nullable String> params) {
|
||||
public void setParameters(Map<String, String> params) {
|
||||
super.setParameters(params);
|
||||
onCmd = getIntParameter("on", 0x2E);
|
||||
offCmd = getIntParameter("off", 0x2F);
|
||||
@@ -1342,7 +1342,7 @@ public abstract class MessageHandler {
|
||||
* @param f the feature for which to create the handler
|
||||
* @return the handler which was created
|
||||
*/
|
||||
public static @Nullable <T extends MessageHandler> T makeHandler(String name, Map<String, @Nullable String> params,
|
||||
public static @Nullable <T extends MessageHandler> T makeHandler(String name, Map<String, String> params,
|
||||
DeviceFeature f) {
|
||||
String cname = MessageHandler.class.getName() + "$" + name;
|
||||
try {
|
||||
|
||||
@@ -151,8 +151,8 @@ public class ModemDBBuilder implements MsgListener {
|
||||
private void logModemDB() {
|
||||
try {
|
||||
logger.debug("MDB ------- start of modem link records ------------------");
|
||||
Map<InsteonAddress, @Nullable ModemDBEntry> dbes = port.getDriver().lockModemDBEntries();
|
||||
for (Entry<InsteonAddress, @Nullable ModemDBEntry> db : dbes.entrySet()) {
|
||||
Map<InsteonAddress, ModemDBEntry> dbes = port.getDriver().lockModemDBEntries();
|
||||
for (Entry<InsteonAddress, ModemDBEntry> db : dbes.entrySet()) {
|
||||
List<Msg> lrs = db.getValue().getLinkRecords();
|
||||
for (Msg m : lrs) {
|
||||
int recordFlags = m.getByte("RecordFlags") & 0xff;
|
||||
@@ -177,7 +177,7 @@ public class ModemDBBuilder implements MsgListener {
|
||||
|
||||
public void updateModemDB(InsteonAddress linkAddr, Port port, @Nullable Msg m, boolean isModem) {
|
||||
try {
|
||||
Map<InsteonAddress, @Nullable ModemDBEntry> dbes = port.getDriver().lockModemDBEntries();
|
||||
Map<InsteonAddress, ModemDBEntry> dbes = port.getDriver().lockModemDBEntries();
|
||||
ModemDBEntry dbe = dbes.get(linkAddr);
|
||||
if (dbe == null) {
|
||||
dbe = new ModemDBEntry(linkAddr, isModem);
|
||||
|
||||
@@ -37,7 +37,7 @@ import org.slf4j.LoggerFactory;
|
||||
public abstract class PollHandler {
|
||||
private static final Logger logger = LoggerFactory.getLogger(PollHandler.class);
|
||||
DeviceFeature feature;
|
||||
Map<String, @Nullable String> parameters = new HashMap<>();
|
||||
Map<String, String> parameters = new HashMap<>();
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
@@ -57,7 +57,7 @@ public abstract class PollHandler {
|
||||
*/
|
||||
public abstract @Nullable Msg makeMsg(InsteonDevice device);
|
||||
|
||||
public void setParameters(Map<String, @Nullable String> hm) {
|
||||
public void setParameters(Map<String, String> hm) {
|
||||
parameters = hm;
|
||||
}
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
package org.openhab.binding.insteon.internal.device;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.PriorityQueue;
|
||||
|
||||
import org.eclipse.jdt.annotation.NonNullByDefault;
|
||||
@@ -41,7 +42,7 @@ public class RequestQueueManager {
|
||||
private final Logger logger = LoggerFactory.getLogger(RequestQueueManager.class);
|
||||
private @Nullable Thread queueThread = null;
|
||||
private PriorityQueue<RequestQueue> requestQueues = new PriorityQueue<>();
|
||||
private HashMap<InsteonDevice, @Nullable RequestQueue> requestQueueHash = new HashMap<>();
|
||||
private Map<InsteonDevice, RequestQueue> requestQueueHash = new HashMap<>();
|
||||
private boolean keepRunning = true;
|
||||
|
||||
private RequestQueueManager() {
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
package org.openhab.binding.insteon.internal.device;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import org.eclipse.jdt.annotation.NonNullByDefault;
|
||||
@@ -139,7 +140,7 @@ public class X10 {
|
||||
return 0xf;
|
||||
}
|
||||
|
||||
private static @Nullable <T, E> T findKey(HashMap<T, E> map, E value) {
|
||||
private static @Nullable <T, E> T findKey(Map<T, E> map, E value) {
|
||||
for (Entry<T, E> entry : map.entrySet()) {
|
||||
if (value.equals(entry.getValue())) {
|
||||
return entry.getKey();
|
||||
@@ -151,11 +152,11 @@ public class X10 {
|
||||
/**
|
||||
* Map between 4-bit X10 code and the house code.
|
||||
*/
|
||||
private static HashMap<Integer, @Nullable String> houseCodeToString = new HashMap<>();
|
||||
private static Map<Integer, String> houseCodeToString = new HashMap<>();
|
||||
/**
|
||||
* Map between 4-bit X10 code and the unit code.
|
||||
*/
|
||||
private static HashMap<Integer, @Nullable Integer> unitCodeToInt = new HashMap<>();
|
||||
private static Map<Integer, Integer> unitCodeToInt = new HashMap<>();
|
||||
|
||||
static {
|
||||
houseCodeToString.put(0x6, "A");
|
||||
|
||||
@@ -36,7 +36,7 @@ public class Driver {
|
||||
private Port port;
|
||||
private String portName;
|
||||
private DriverListener listener;
|
||||
private Map<InsteonAddress, @Nullable ModemDBEntry> modemDBEntries = new HashMap<>();
|
||||
private Map<InsteonAddress, ModemDBEntry> modemDBEntries = new HashMap<>();
|
||||
private ReentrantLock modemDBEntriesLock = new ReentrantLock();
|
||||
|
||||
public Driver(String portName, DriverListener listener, @Nullable SerialPortManager serialPortManager,
|
||||
@@ -51,7 +51,7 @@ public class Driver {
|
||||
return port.isRunning();
|
||||
}
|
||||
|
||||
public Map<InsteonAddress, @Nullable ModemDBEntry> lockModemDBEntries() {
|
||||
public Map<InsteonAddress, ModemDBEntry> lockModemDBEntries() {
|
||||
modemDBEntriesLock.lock();
|
||||
return modemDBEntries;
|
||||
}
|
||||
|
||||
@@ -152,7 +152,7 @@ public class Port {
|
||||
*/
|
||||
public void clearModemDB() {
|
||||
logger.debug("clearing modem db!");
|
||||
Map<InsteonAddress, @Nullable ModemDBEntry> dbes = getDriver().lockModemDBEntries();
|
||||
Map<InsteonAddress, ModemDBEntry> dbes = getDriver().lockModemDBEntries();
|
||||
for (InsteonAddress addr : dbes.keySet()) {
|
||||
if (!dbes.get(addr).isModem()) {
|
||||
dbes.remove(addr);
|
||||
|
||||
@@ -162,7 +162,7 @@ public class InsteonDeviceHandler extends BaseThingHandler {
|
||||
}
|
||||
|
||||
String deviceConfig = config.getDeviceConfig();
|
||||
Map<String, @Nullable Object> deviceConfigMap;
|
||||
Map<String, Object> deviceConfigMap;
|
||||
if (deviceConfig != null) {
|
||||
Type mapType = new TypeToken<Map<String, Object>>() {
|
||||
}.getType();
|
||||
@@ -368,7 +368,7 @@ public class InsteonDeviceHandler extends BaseThingHandler {
|
||||
return;
|
||||
}
|
||||
|
||||
Map<String, @Nullable String> params = new HashMap<>();
|
||||
Map<String, String> params = new HashMap<>();
|
||||
Channel channel = getThing().getChannel(channelUID.getId());
|
||||
|
||||
Map<String, Object> channelProperties = channel.getConfiguration().getProperties();
|
||||
|
||||
@@ -74,11 +74,11 @@ public class Msg {
|
||||
}
|
||||
|
||||
// has the structure of all known messages
|
||||
private static final Map<String, @Nullable Msg> MSG_MAP = new HashMap<>();
|
||||
private static final Map<String, Msg> MSG_MAP = new HashMap<>();
|
||||
// maps between command number and the length of the header
|
||||
private static final Map<Integer, @Nullable Integer> HEADER_MAP = new HashMap<>();
|
||||
private static final Map<Integer, Integer> HEADER_MAP = new HashMap<>();
|
||||
// has templates for all message from modem to host
|
||||
private static final Map<Integer, @Nullable Msg> REPLY_MAP = new HashMap<>();
|
||||
private static final Map<Integer, Msg> REPLY_MAP = new HashMap<>();
|
||||
|
||||
private int headerLength = -1;
|
||||
private byte @Nullable [] data = null;
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
package org.openhab.binding.insteon.internal.message;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.eclipse.jdt.annotation.NonNullByDefault;
|
||||
import org.eclipse.jdt.annotation.Nullable;
|
||||
@@ -28,7 +29,7 @@ import org.eclipse.jdt.annotation.Nullable;
|
||||
@NonNullByDefault
|
||||
@SuppressWarnings("null")
|
||||
public class MsgDefinition {
|
||||
private HashMap<String, @Nullable Field> fields = new HashMap<>();
|
||||
private Map<String, Field> fields = new HashMap<>();
|
||||
|
||||
MsgDefinition() {
|
||||
}
|
||||
@@ -42,7 +43,7 @@ public class MsgDefinition {
|
||||
fields = new HashMap<>(m.fields);
|
||||
}
|
||||
|
||||
public HashMap<String, @Nullable Field> getFields() {
|
||||
public Map<String, Field> getFields() {
|
||||
return fields;
|
||||
}
|
||||
|
||||
|
||||
@@ -13,9 +13,9 @@
|
||||
package org.openhab.binding.insteon.internal.message;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.eclipse.jdt.annotation.NonNullByDefault;
|
||||
import org.eclipse.jdt.annotation.Nullable;
|
||||
|
||||
/**
|
||||
* Represents insteon message type flags
|
||||
@@ -47,7 +47,7 @@ public enum MsgType {
|
||||
ALL_LINK_CLEANUP_NACK(0xe0),
|
||||
INVALID(0xff); // should never happen
|
||||
|
||||
private static HashMap<Integer, @Nullable MsgType> hash = new HashMap<>();
|
||||
private static Map<Integer, MsgType> hash = new HashMap<>();
|
||||
|
||||
private byte byteValue = 0;
|
||||
|
||||
@@ -73,7 +73,6 @@ public enum MsgType {
|
||||
|
||||
public static MsgType fromValue(byte b) throws IllegalArgumentException {
|
||||
int i = b & 0xe0;
|
||||
@Nullable
|
||||
MsgType mt = hash.get(i);
|
||||
if (mt == null) {
|
||||
throw new IllegalArgumentException("msg type of byte value " + i + " not found");
|
||||
|
||||
Reference in New Issue
Block a user