From 989aca34d990089758a10cae4b48383ec3bc1f5a Mon Sep 17 00:00:00 2001 From: lsiepel Date: Tue, 20 Dec 2022 00:06:52 +0100 Subject: [PATCH] null annotations (#13976) Signed-off-by: Leo Siepel Signed-off-by: Andras Uhrin --- .../binding/bluetooth/blukii/BlukiiBindingConstants.java | 2 ++ .../binding/bluetooth/blukii/handler/BlukiiHandler.java | 3 +-- .../bluetooth/blukii/internal/BlukiiHandlerFactory.java | 5 ++++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/bundles/org.openhab.binding.bluetooth.blukii/src/main/java/org/openhab/binding/bluetooth/blukii/BlukiiBindingConstants.java b/bundles/org.openhab.binding.bluetooth.blukii/src/main/java/org/openhab/binding/bluetooth/blukii/BlukiiBindingConstants.java index 7306a8d3bf8ee..e5124c6d37599 100644 --- a/bundles/org.openhab.binding.bluetooth.blukii/src/main/java/org/openhab/binding/bluetooth/blukii/BlukiiBindingConstants.java +++ b/bundles/org.openhab.binding.bluetooth.blukii/src/main/java/org/openhab/binding/bluetooth/blukii/BlukiiBindingConstants.java @@ -12,6 +12,7 @@ */ package org.openhab.binding.bluetooth.blukii; +import org.eclipse.jdt.annotation.NonNullByDefault; import org.openhab.binding.bluetooth.BluetoothBindingConstants; import org.openhab.core.thing.ThingTypeUID; @@ -21,6 +22,7 @@ * * @author Kai Kreuzer - Initial contribution */ +@NonNullByDefault public class BlukiiBindingConstants { // List of all Thing Type UIDs diff --git a/bundles/org.openhab.binding.bluetooth.blukii/src/main/java/org/openhab/binding/bluetooth/blukii/handler/BlukiiHandler.java b/bundles/org.openhab.binding.bluetooth.blukii/src/main/java/org/openhab/binding/bluetooth/blukii/handler/BlukiiHandler.java index 0d1e70e1171ad..8d6e409d235ab 100644 --- a/bundles/org.openhab.binding.bluetooth.blukii/src/main/java/org/openhab/binding/bluetooth/blukii/handler/BlukiiHandler.java +++ b/bundles/org.openhab.binding.bluetooth.blukii/src/main/java/org/openhab/binding/bluetooth/blukii/handler/BlukiiHandler.java @@ -14,7 +14,6 @@ import org.eclipse.jdt.annotation.NonNullByDefault; import org.openhab.binding.bluetooth.BeaconBluetoothHandler; -import org.openhab.binding.bluetooth.BluetoothDeviceListener; import org.openhab.binding.bluetooth.blukii.BlukiiBindingConstants; import org.openhab.binding.bluetooth.blukii.internal.data.BlukiiData; import org.openhab.binding.bluetooth.blukii.internal.data.BlukiiDataDecoder; @@ -34,7 +33,7 @@ * @author Markus Rathgeb - Split data (decoding and types) and handler */ @NonNullByDefault -public class BlukiiHandler extends BeaconBluetoothHandler implements BluetoothDeviceListener { +public class BlukiiHandler extends BeaconBluetoothHandler { private final BlukiiDataDecoder decoder = new BlukiiDataDecoder(); diff --git a/bundles/org.openhab.binding.bluetooth.blukii/src/main/java/org/openhab/binding/bluetooth/blukii/internal/BlukiiHandlerFactory.java b/bundles/org.openhab.binding.bluetooth.blukii/src/main/java/org/openhab/binding/bluetooth/blukii/internal/BlukiiHandlerFactory.java index ff04830da5e04..58030ea896070 100644 --- a/bundles/org.openhab.binding.bluetooth.blukii/src/main/java/org/openhab/binding/bluetooth/blukii/internal/BlukiiHandlerFactory.java +++ b/bundles/org.openhab.binding.bluetooth.blukii/src/main/java/org/openhab/binding/bluetooth/blukii/internal/BlukiiHandlerFactory.java @@ -15,6 +15,8 @@ import java.util.Collections; import java.util.Set; +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; import org.openhab.binding.bluetooth.blukii.BlukiiBindingConstants; import org.openhab.binding.bluetooth.blukii.handler.BlukiiHandler; import org.openhab.core.thing.Thing; @@ -29,6 +31,7 @@ * * @author Kai Kreuzer - Initial contribution */ +@NonNullByDefault @Component(service = ThingHandlerFactory.class, configurationPid = "binding.blukii") public class BlukiiHandlerFactory extends BaseThingHandlerFactory { @@ -41,7 +44,7 @@ public boolean supportsThingType(ThingTypeUID thingTypeUID) { } @Override - protected ThingHandler createHandler(Thing thing) { + protected @Nullable ThingHandler createHandler(Thing thing) { ThingTypeUID thingTypeUID = thing.getThingTypeUID(); if (thingTypeUID.equals(BlukiiBindingConstants.THING_TYPE_BEACON)) {