]> git.basschouten.com Git - openhab-addons.git/commitdiff
null annotations - checkstyle (#13979)
authorlsiepel <leosiepel@gmail.com>
Tue, 27 Dec 2022 15:16:55 +0000 (16:16 +0100)
committerGitHub <noreply@github.com>
Tue, 27 Dec 2022 15:16:55 +0000 (16:16 +0100)
Signed-off-by: Leo Siepel <leosiepel@gmail.com>
bundles/org.openhab.binding.bluetooth.generic/src/main/java/org/openhab/binding/bluetooth/generic/internal/BluetoothUnit.java
bundles/org.openhab.binding.bluetooth.generic/src/main/java/org/openhab/binding/bluetooth/generic/internal/CharacteristicChannelTypeProvider.java
bundles/org.openhab.binding.bluetooth.generic/src/main/java/org/openhab/binding/bluetooth/generic/internal/GenericBluetoothHandler.java
bundles/org.openhab.binding.bluetooth.generic/src/test/java/org/openhab/binding/bluetooth/generic/internal/BluetoothUnitTest.java

index 411256e191848bfbbab8a485517a27831b2ca377..ce21c6debd8c19e7b873d2b6a1853e987b6a7f73 100644 (file)
@@ -230,9 +230,6 @@ public enum BluetoothUnit {
         public static final Unit<ArealDensity> KILOGRAM_PER_SQUARE_METER = addUnit(
                 new ProductUnit<ArealDensity>(SIUnits.KILOGRAM.divide(SIUnits.SQUARE_METRE)));
 
-        public static final Unit<RadiationExposure> COULOMB_PER_KILOGRAM = addUnit(
-                new ProductUnit<RadiationExposure>(Units.COULOMB.divide(SIUnits.KILOGRAM)));
-
         public static final Unit<RadiationDoseAbsorptionRate> GRAY_PER_SECOND = addUnit(
                 new ProductUnit<RadiationDoseAbsorptionRate>(Units.GRAY.divide(Units.SECOND)));
 
index 52a80c50478df09e3b381e2bf6a3c78150695c59..4b523a14195b62c7ffdd1d5530a80de4af8371fa 100644 (file)
@@ -108,10 +108,7 @@ public class CharacteristicChannelTypeProvider implements ChannelTypeProvider {
         if (channelID.charAt(30) != '-') {
             return false;
         }
-        if (channelID.charAt(67) != '-') {
-            return false;
-        }
-        return true;
+        return !(channelID.charAt(67) != '-');
     }
 
     public ChannelTypeUID registerChannelType(String characteristicUUID, boolean advanced, boolean readOnly,
@@ -135,7 +132,7 @@ public class CharacteristicChannelTypeProvider implements ChannelTypeProvider {
             throw new IllegalStateException("Unknown field format type: " + field.getUnit());
         }
 
-        if (itemType.equals("Switch")) {
+        if ("Switch".equals(itemType)) {
             options = Collections.emptyList();
         }
 
index 644e23bf898f80dd1932a27f76c839eb85580508..c1f8a58484951ad79ff8b65d61a0b4336f8a9378 100644 (file)
@@ -202,7 +202,7 @@ public class GenericBluetoothHandler extends ConnectedBluetoothHandler {
                                     .hasPropertyEnabled(BluetoothCharacteristic.PROPERTY_BROADCAST))
                             .collect(Collectors.toUnmodifiableList());
 
-                    if (broadcastCharacteristics.size() == 0) {
+                    if (broadcastCharacteristics.isEmpty()) {
                         logger.info(
                                 "No Characteristic of service with UUID {} on {} has the broadcast property set, ignored.",
                                 uuidStr, scanNotification.getAddress());
@@ -298,7 +298,6 @@ public class GenericBluetoothHandler extends ConnectedBluetoothHandler {
         }
 
         public void handleCommand(ChannelUID channelUID, Command command) {
-
             // Handle REFRESH
             if (command == RefreshType.REFRESH) {
                 if (canRead()) {
index 3ef65307d54b016ffc3c57b14ef459659f24bdab..bc90cb9bf90993ac90b0f97960850a668515c90c 100644 (file)
  */
 package org.openhab.binding.bluetooth.generic.internal;
 
+import org.eclipse.jdt.annotation.NonNullByDefault;
 import org.junit.jupiter.api.Test;
 
 /**
  * @author Connor Petty - Initial contribution
  *
  */
+@NonNullByDefault
 class BluetoothUnitTest {
 
     @Test