[infrastructure] move infered nullness warnings to error and update EEA (#8949)

Signed-off-by: Jan N. Klug <jan.n.klug@rub.de>
This commit is contained in:
J-N-K
2020-11-12 21:07:11 +01:00
committed by GitHub
parent 0856a0b3f2
commit ba4c96d99d
155 changed files with 644 additions and 632 deletions

View File

@@ -30,6 +30,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.gson.Gson;
import com.google.gson.JsonSyntaxException;
/**
* KVVBridgeHandler encapsulates the communication with the KVV API.
@@ -106,7 +107,7 @@ public class KVVBridgeHandler extends BaseBridgeHandler {
DepartureResult result;
try {
result = new Gson().fromJson(data, DepartureResult.class);
} catch (Exception e) {
} catch (JsonSyntaxException e) {
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, "Failed to connect to KVV API");
logger.debug("Failed to parse departure data", e);
logger.debug("Server returned '{}'", data);
@@ -114,6 +115,10 @@ public class KVVBridgeHandler extends BaseBridgeHandler {
return null;
}
if (result == null) {
return null;
}
if (this.wasOffline) {
updateStatus(ThingStatus.ONLINE);
}
@@ -132,7 +137,6 @@ public class KVVBridgeHandler extends BaseBridgeHandler {
/**
* Creates a new @{link Cache}.
*
* @param updateInterval the @{code updateInterval}
*/
public Cache() {
this.updateInterval = KVVBindingConstants.CACHE_DEFAULT_UPDATEINTERVAL;