[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:
J-N-K
2020-11-12 21:07:11 +01:00
committed by GitHub
parent 0856a0b3f2
commit ba4c96d99d
155 changed files with 644 additions and 632 deletions

View File

@@ -15,6 +15,7 @@ package org.openhab.binding.bluetooth.roaming.internal;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.atomic.AtomicReference;
@@ -52,7 +53,7 @@ public class RoamingBluetoothDevice extends DelegateBluetoothDevice {
}
public void addBluetoothDevice(BluetoothDevice device) {
device.addListener(devices.computeIfAbsent(device, Listener::new));
device.addListener(Objects.requireNonNull(devices.computeIfAbsent(device, Listener::new)));
}
public void removeBluetoothDevice(BluetoothDevice device) {

View File

@@ -14,6 +14,7 @@ package org.openhab.binding.bluetooth.roaming.internal;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.concurrent.CopyOnWriteArraySet;
import java.util.stream.Stream;
@@ -216,8 +217,8 @@ public class RoamingBridgeHandler extends BaseBridgeHandler implements RoamingBl
public RoamingBluetoothDevice getDevice(BluetoothAddress address) {
// this will only get called by a bluetooth device handler
synchronized (devices) {
RoamingBluetoothDevice roamingDevice = devices.computeIfAbsent(address,
addr -> new RoamingBluetoothDevice(this, addr));
RoamingBluetoothDevice roamingDevice = Objects
.requireNonNull(devices.computeIfAbsent(address, addr -> new RoamingBluetoothDevice(this, addr)));
adapters.stream().filter(this::isRoamingMember)
.forEach(adapter -> roamingDevice.addBluetoothDevice(adapter.getDevice(address)));