Remove unused local variables (#10528)

Fixes 26 SAT UnusedLocalVariable findings

Signed-off-by: Wouter Born <github@maindrain.net>
This commit is contained in:
Wouter Born
2021-04-16 22:35:01 +02:00
committed by GitHub
parent 030329c118
commit b42101addc
20 changed files with 37 additions and 76 deletions

View File

@@ -263,7 +263,6 @@ public class ShellyComponents {
updated |= thingHandler.updateChannel(CHANNEL_GROUP_SENSOR, CHANNEL_SENSOR_CONTACT,
getString(sdata.sensor.state).equalsIgnoreCase(SHELLY_API_DWSTATE_OPEN) ? OpenClosedType.OPEN
: OpenClosedType.CLOSED);
String sensorError = getString(sdata.sensorError);
boolean changed = thingHandler.updateChannel(CHANNEL_GROUP_SENSOR, CHANNEL_SENSOR_ERROR,
getStringType(sdata.sensorError));
if (changed) {

View File

@@ -227,7 +227,7 @@ public class ShellyManagerActionPage extends ShellyManagerPage {
actionUrl = buildActionUrl(uid, action);
} else {
try {
String result = api.resetStaCache();
api.resetStaCache();
message = getMessage("action.resetsta-confirm");
} catch (ShellyApiException e) {
message = getMessageP("action.resetsta-failed", e.toString());
@@ -243,7 +243,7 @@ public class ShellyManagerActionPage extends ShellyManagerPage {
actionUrl = buildActionUrl(uid, action);
} else {
try {
String result = api.setWiFiRecovery(enable);
api.setWiFiRecovery(enable);
message = getMessage("action.setwifirec-confirm", enable ? "enabled" : "disabled");
} catch (ShellyApiException e) {
message = getMessage("action.setwifirec-failed", e.toString());
@@ -260,7 +260,7 @@ public class ShellyManagerActionPage extends ShellyManagerPage {
actionUrl = buildActionUrl(uid, action);
} else {
try {
String result = api.setApRoaming(enable);
api.setApRoaming(enable);
message = getMessage("action.aproaming-confirm", enable ? "enabled" : "disabled");
} catch (ShellyApiException e) {
message = getMessage("action.aproaming-failed", e.toString());

View File

@@ -91,7 +91,7 @@ public class ShellyManagerCache<K, V> extends ConcurrentHashMap<K, V> {
long currentTime = new Date().getTime();
for (K key : timeMap.keySet()) {
if (currentTime > (timeMap.get(key) + expiryInMillis)) {
V value = remove(key);
remove(key);
timeMap.remove(key);
}
}