[infrastructure] add external null-annotations (#8848)
Signed-off-by: Jan N. Klug <jan.n.klug@rub.de>
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
package org.openhab.binding.miio.internal;
|
||||
|
||||
import org.eclipse.jdt.annotation.NonNullByDefault;
|
||||
import org.eclipse.jdt.annotation.Nullable;
|
||||
|
||||
/**
|
||||
* Will be thrown instead of the many possible errors in the crypto module
|
||||
@@ -31,11 +32,11 @@ public class MiIoCryptoException extends Exception {
|
||||
super();
|
||||
}
|
||||
|
||||
public MiIoCryptoException(String message) {
|
||||
public MiIoCryptoException(@Nullable String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
public MiIoCryptoException(String message, Exception e) {
|
||||
public MiIoCryptoException(@Nullable String message, @Nullable Exception e) {
|
||||
super(message, e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
package org.openhab.binding.miio.internal.cloud;
|
||||
|
||||
import org.eclipse.jdt.annotation.NonNullByDefault;
|
||||
import org.eclipse.jdt.annotation.Nullable;
|
||||
|
||||
/**
|
||||
* Will be thrown for cloud errors
|
||||
@@ -30,11 +31,11 @@ public class MiCloudException extends Exception {
|
||||
super();
|
||||
}
|
||||
|
||||
public MiCloudException(String message) {
|
||||
public MiCloudException(@Nullable String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
public MiCloudException(String message, Exception e) {
|
||||
public MiCloudException(@Nullable String message, @Nullable Exception e) {
|
||||
super(message, e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -278,8 +278,9 @@ public abstract class MiIoAbstractHandler extends BaseThingHandler implements Mi
|
||||
disconnected("No Response from device");
|
||||
}
|
||||
|
||||
protected void disconnected(String message) {
|
||||
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.OFFLINE.COMMUNICATION_ERROR, message);
|
||||
protected void disconnected(@Nullable String message) {
|
||||
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.OFFLINE.COMMUNICATION_ERROR,
|
||||
message != null ? message : "");
|
||||
final MiIoAsyncCommunication miioCom = this.miioCom;
|
||||
if (miioCom != null) {
|
||||
lastId = miioCom.getId();
|
||||
|
||||
@@ -28,6 +28,7 @@ import java.util.Map;
|
||||
import java.util.zip.GZIPInputStream;
|
||||
|
||||
import org.eclipse.jdt.annotation.NonNullByDefault;
|
||||
import org.eclipse.jdt.annotation.Nullable;
|
||||
import org.openhab.binding.miio.internal.Utils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@@ -358,7 +359,11 @@ public class RRMapFileParser {
|
||||
return sw.toString();
|
||||
}
|
||||
|
||||
private void printAreaDetails(ArrayList<float[]> areas, PrintWriter pw) {
|
||||
private void printAreaDetails(@Nullable ArrayList<float[]> areas, PrintWriter pw) {
|
||||
if (areas == null) {
|
||||
pw.println("null");
|
||||
return;
|
||||
}
|
||||
areas.forEach(area -> {
|
||||
pw.print("\tArea coordinates:");
|
||||
for (int i = 0; i < area.length; i++) {
|
||||
@@ -368,7 +373,11 @@ public class RRMapFileParser {
|
||||
});
|
||||
}
|
||||
|
||||
private void printObstacleDetails(ArrayList<int[]> obstacle, PrintWriter pw) {
|
||||
private void printObstacleDetails(@Nullable ArrayList<int[]> obstacle, PrintWriter pw) {
|
||||
if (obstacle == null) {
|
||||
pw.println("null");
|
||||
return;
|
||||
}
|
||||
obstacle.forEach(area -> {
|
||||
pw.print("\tObstacle coordinates:");
|
||||
for (int i = 0; i < area.length; i++) {
|
||||
|
||||
Reference in New Issue
Block a user