diff options
author | priyanka.akhade <priyanka.akhade@huawei.com> | 2020-03-04 14:21:12 +0000 |
---|---|---|
committer | priyanka.akhade <priyanka.akhade@huawei.com> | 2020-03-04 14:21:12 +0000 |
commit | cf1ab5db1033e403dfc839d5fbbe0580be1d497b (patch) | |
tree | 3396e8fc8e02ae17e457aa9212a1759e51d01641 /framework/src/main | |
parent | 92d3092901ab1866766953e5f8d74bacf27bbc8f (diff) |
Resolved JsonElement issue for grpc server and other classes
Issue-ID: CLI-247
Signed-off-by: priyanka.akhade <priyanka.akhade@huawei.com>
Change-Id: Ifcfba782ec6454f58d1df11e6ab7db3e1a04d17b
Diffstat (limited to 'framework/src/main')
-rw-r--r-- | framework/src/main/java/org/onap/cli/fw/output/print/OnapCommandPrint.java | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/framework/src/main/java/org/onap/cli/fw/output/print/OnapCommandPrint.java b/framework/src/main/java/org/onap/cli/fw/output/print/OnapCommandPrint.java index c4be02e3..8d707906 100644 --- a/framework/src/main/java/org/onap/cli/fw/output/print/OnapCommandPrint.java +++ b/framework/src/main/java/org/onap/cli/fw/output/print/OnapCommandPrint.java @@ -31,8 +31,7 @@ import org.apache.commons.csv.CSVPrinter; import org.onap.cli.fw.error.OnapCommandOutputPrintingFailed; import org.onap.cli.fw.output.OnapCommandPrintDirection; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; +import com.google.gson.JsonParser; import net.minidev.json.JSONArray; import net.minidev.json.JSONObject; @@ -43,7 +42,6 @@ import net.minidev.json.JSONValue; */ public class OnapCommandPrint { - private static Gson gson = new GsonBuilder().serializeNulls().create(); public static final int MAX_COLUMN_LENGTH = 50; @@ -273,7 +271,7 @@ public class OnapCommandPrint { array.add(rowO); } try { - return gson.toJson(array.toJSONString()).toString(); + return new JsonParser().parse(array.toJSONString()).toString(); } catch (Exception e) { // NOSONAR // TODO Auto-generated catch block return array.toJSONString(); |