[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:
@@ -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) {
|
||||
|
||||
@@ -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)));
|
||||
|
||||
Reference in New Issue
Block a user