*Move string literal to the left side of comparison
Null check is performed by String.equalsIgnorecase hence removed
Issue-Id: CCSDK-117
Change-Id: I48c8815f9f20a1c6e86c8b4af8966c9945d5b0c7
Signed-off-by: surya-huawei <a.u.surya@huawei.com>
JSON, XML;
public static Format fromString(String s) {
JSON, XML;
public static Format fromString(String s) {
- if (s == null)
- return null;
- if (s.equalsIgnoreCase("json"))
+ if ("json".equalsIgnoreCase(s))
- if (s.equalsIgnoreCase("xml"))
+ if ("xml".equalsIgnoreCase(s))
return XML;
throw new IllegalArgumentException("Invalid value for format: " + s);
}
return XML;
throw new IllegalArgumentException("Invalid value for format: " + s);
}