Skip to content

Commit

Permalink
Merge pull request #1121 from gaudryc/master
Browse files Browse the repository at this point in the history
Fix the bad practice "Comparison of String objects using == or !=".
  • Loading branch information
bwssytems authored Aug 19, 2019
2 parents 87f79df + 8b48f23 commit ee4afc0
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ public void setColor(String color) {
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 + "}";
Expand Down

0 comments on commit ee4afc0

Please sign in to comment.