Skip to content

Commit

Permalink
null annotations - checkstyle (openhab#13979)
Browse files Browse the repository at this point in the history
Signed-off-by: Leo Siepel <leosiepel@gmail.com>
  • Loading branch information
lsiepel authored Dec 27, 2022
1 parent df6454e commit 8b1d0fc
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -230,9 +230,6 @@ public static class BUnits {
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)));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,7 @@ private static boolean isValidUID(ChannelTypeUID channelTypeUID) {
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,
Expand All @@ -135,7 +132,7 @@ private ChannelType buildChannelType(ChannelTypeUID channelTypeUID, boolean adva
throw new IllegalStateException("Unknown field format type: " + field.getUnit());
}

if (itemType.equals("Switch")) {
if ("Switch".equals(itemType)) {
options = Collections.emptyList();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ private void handleServiceData(BluetoothScanNotification scanNotification) {
.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());
Expand Down Expand Up @@ -298,7 +298,6 @@ private String getCharacteristicUUID() {
}

public void handleCommand(ChannelUID channelUID, Command command) {

// Handle REFRESH
if (command == RefreshType.REFRESH) {
if (canRead()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8b1d0fc

Please sign in to comment.