[infrastructure] add external null-annotations (#8848)

Signed-off-by: Jan N. Klug <jan.n.klug@rub.de>
This commit is contained in:
J-N-K
2020-10-31 00:29:03 +01:00
committed by GitHub
parent 47d05055db
commit bd664ff0c8
162 changed files with 933 additions and 575 deletions

View File

@@ -135,9 +135,9 @@ class OpenHabToDeviceConverter {
final String manufacturer = StringUtils.isEmpty(properties.get("Manufacturer")) ? "openHAB"
: properties.get("Manufacturer");
final Integer standbyDelay = parseInteger(properties.get("Standby Command Delay"));
final Integer switchDelay = parseInteger(properties.get("Source Switch Delay"));
final Integer shutDownDelay = parseInteger(properties.get("Shutdown Delay"));
final Integer standbyDelay = parseInteger(properties.getOrDefault("Standby Command Delay", "0"));
final Integer switchDelay = parseInteger(properties.getOrDefault("Source Switch Delay", "0"));
final Integer shutDownDelay = parseInteger(properties.getOrDefault("Shutdown Delay", "0"));
final NeeoDeviceTiming timing = new NeeoDeviceTiming(standbyDelay, switchDelay, shutDownDelay);

View File

@@ -74,7 +74,8 @@ public class HttpRequest implements AutoCloseable {
content.close();
}
} catch (IOException | IllegalStateException | ProcessingException e) {
return new HttpResponse(HttpStatus.SERVICE_UNAVAILABLE_503, e.getMessage());
String message = e.getMessage();
return new HttpResponse(HttpStatus.SERVICE_UNAVAILABLE_503, message != null ? message : "");
}
}
@@ -100,7 +101,8 @@ public class HttpRequest implements AutoCloseable {
content.close();
}
} catch (IOException | IllegalStateException | ProcessingException e) {
return new HttpResponse(HttpStatus.SERVICE_UNAVAILABLE_503, e.getMessage());
String message = e.getMessage();
return new HttpResponse(HttpStatus.SERVICE_UNAVAILABLE_503, message != null ? message : "");
}
}

View File

@@ -101,7 +101,7 @@ public class HttpResponse {
return "";
}
return new String(contents, StandardCharsets.UTF_8);
return new String(localContents, StandardCharsets.UTF_8);
}
/**