null annotations - checkstyle (#13979)

Signed-off-by: Leo Siepel <leosiepel@gmail.com>
pull/14075/head
lsiepel 2022-12-27 16:16:55 +01:00 committed by GitHub
parent df6454e374
commit 8b1d0fccef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 10 deletions

View 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)));

View 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();
}

View 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()) {

View File

@ -12,12 +12,14 @@
*/
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