Java 17 features (T-Z) (#15576)
- add missing @override - Java style array syntax - remove redundant modifiers - always move String constants to left side in comparisons - simplify lambda expressions and return statements - use replace instead of replaceAll w/o regex - instanceof matching and multiline strings - remove null check before instanceof Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
This commit is contained in:
@@ -299,7 +299,7 @@ public class YamahaMusiccastHandler extends BaseThingHandler {
|
||||
if (distributioninfo != null) {
|
||||
responseCode = distributioninfo.getResponseCode();
|
||||
localRole = distributioninfo.getRole();
|
||||
if (command.toString().equals("")) {
|
||||
if ("".equals(command.toString())) {
|
||||
action = "unlink";
|
||||
groupId = distributioninfo.getGroupId();
|
||||
} else if (command.toString().contains("***")) {
|
||||
@@ -354,12 +354,12 @@ public class YamahaMusiccastHandler extends BaseThingHandler {
|
||||
httpResponse = startDistribution(mclinkSetupServer);
|
||||
localDefaultAfterMCLink = getThing().getConfiguration()
|
||||
.get("defaultAfterMCLink").toString();
|
||||
httpResponse = setInput(localDefaultAfterMCLink.toString(), zone, this.host);
|
||||
httpResponse = setInput(localDefaultAfterMCLink, zone, this.host);
|
||||
} else if ("".equals(mclinkSetupServer)) {
|
||||
// fallback in case client is removed from group by ending group on server side
|
||||
localDefaultAfterMCLink = getThing().getConfiguration()
|
||||
.get("defaultAfterMCLink").toString();
|
||||
httpResponse = setInput(localDefaultAfterMCLink.toString(), zone, this.host);
|
||||
httpResponse = setInput(localDefaultAfterMCLink, zone, this.host);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -795,8 +795,8 @@ public class YamahaMusiccastHandler extends BaseThingHandler {
|
||||
JsonObject presetObject = pr.getAsJsonObject();
|
||||
String text = presetObject.get("text").getAsString();
|
||||
if (!"".equals(text)) {
|
||||
optionsPresets.add(new StateOption(String.valueOf(presetCounter),
|
||||
"#" + String.valueOf(presetCounter) + " " + text));
|
||||
optionsPresets.add(
|
||||
new StateOption(String.valueOf(presetCounter), "#" + presetCounter + " " + text));
|
||||
if (inputText.equals(text)) {
|
||||
currentPreset = presetCounter;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user