Fix the bad practice "Comparison of String objects using == or !=".

This commit is contained in:
gaudryc
2019-08-18 22:33:27 +02:00
parent 87f79df8b1
commit 8b48f23741

View File

@@ -41,10 +41,10 @@ public class MozIotCommandDetail {
public String getBody() {
String theBody = "";
if(level != null && level != "") {
if(level != null && !"".equals(level)) {
theBody = "{\"level\":" + level + "}";
}
else if(color != null && color != "") {
else if(color != null && !"".equals(color)) {
theBody = "{\"color\":\"" + color + "\"}";
} else {
theBody = "{\"on\":" + on + "}";