summary |
shortlog |
log |
commit | commitdiff |
review |
tree
raw |
patch |
inline | side by side (from parent 1:
9df5c4d)
Issue-ID: CLI-439
Signed-off-by: sharath reddy <bs.reddy@huawei.com>
Change-Id: I49fdc2fe1aa48ae78317aba94fdd7f0232334860
Signed-off-by: sharath reddy <bs.reddy@huawei.com>
- return new JsonParser().parse(array.toJSONString()).toString();
+ return JsonParser.parseString(array.toJSONString()).toString();
} catch (Exception e) { // NOSONAR
return array.toJSONString();
}
} catch (Exception e) { // NOSONAR
return array.toJSONString();
}
public static void setOutputAttr(Builder reply, String printOut){
try {
public static void setOutputAttr(Builder reply, String printOut){
try {
- reply.putAttrs(OnapCommandConstants.RESULTS, new JsonParser().parse(printOut).toString());
+ reply.putAttrs(OnapCommandConstants.RESULTS, JsonParser.parseString(printOut).toString());
} catch (Exception e) { // NOSONAR
reply.putAttrs(OnapCommandConstants.RESULTS, printOut);
}
} catch (Exception e) { // NOSONAR
reply.putAttrs(OnapCommandConstants.RESULTS, printOut);
}
}
public static String normalizeJson(String json) throws OnapCommandHttpInvalidRequestBody {
}
public static String normalizeJson(String json) throws OnapCommandHttpInvalidRequestBody {
- JsonParser jsonParser = new JsonParser();
- node = jsonParser.parse(json);
+ node = JsonParser.parseString(json);
normalizeJson(node);
return gson.toJson(node);
} catch (Exception e) { //NOSONAR
normalizeJson(node);
return gson.toJson(node);
} catch (Exception e) { //NOSONAR
public void setJson(String json) throws IOException { //NOSONAR
if (!json.isEmpty()) {
try {
public void setJson(String json) throws IOException { //NOSONAR
if (!json.isEmpty()) {
try {
- JsonParser parser = new JsonParser();
- this.json = parser.parse(json);
+ this.json = JsonParser.parseString(json);
- this.json = new JsonParser().parse("{}");
+ this.json = JsonParser.parseString("{}");
public void setJson(String json) throws IOException { //NOSONAR
if (json != null && !json.isEmpty()) {
try {
public void setJson(String json) throws IOException { //NOSONAR
if (json != null && !json.isEmpty()) {
try {
- JsonParser parser = new JsonParser();
- this.json = parser.parse(json);
+ this.json = JsonParser.parseString(json);
- this.json = new JsonParser().parse("{}");
+ this.json = JsonParser.parseString("{}");