diff options
author | 2020-03-05 06:35:52 +0000 | |
---|---|---|
committer | 2020-03-05 06:35:52 +0000 | |
commit | 7fd4e74500eaf8d684f615495f7debddc146b888 (patch) | |
tree | 188e48cdf8dae87a820fd5688a74e6123d501fbc /grpc/grpc-server/src/main | |
parent | ee6c134312bff3506f4f7eca695dad7d0dfec2d9 (diff) | |
parent | cf1ab5db1033e403dfc839d5fbbe0580be1d497b (diff) |
Merge "Resolved JsonElement issue for grpc server and other classes"
Diffstat (limited to 'grpc/grpc-server/src/main')
-rw-r--r-- | grpc/grpc-server/src/main/java/org/open/infc/grpc/server/OpenInterfaceGrpcServer.java | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/grpc/grpc-server/src/main/java/org/open/infc/grpc/server/OpenInterfaceGrpcServer.java b/grpc/grpc-server/src/main/java/org/open/infc/grpc/server/OpenInterfaceGrpcServer.java index 8b9448b7..93b5beee 100644 --- a/grpc/grpc-server/src/main/java/org/open/infc/grpc/server/OpenInterfaceGrpcServer.java +++ b/grpc/grpc-server/src/main/java/org/open/infc/grpc/server/OpenInterfaceGrpcServer.java @@ -45,8 +45,7 @@ import org.open.infc.grpc.Result; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; +import com.google.gson.JsonParser; import io.grpc.Server; import io.grpc.ServerBuilder; @@ -55,7 +54,6 @@ import io.grpc.stub.StreamObserver; public class OpenInterfaceGrpcServer { private static final Logger logger = LoggerFactory.getLogger(OpenInterfaceGrpcServer.class.getName()); - private static Gson gson = new GsonBuilder().serializeNulls().create(); private static final String CONF_FILE = "oclip-grpc-server.properties"; private static final String CONF_SERVER_PORT = "oclip.grpc_server_port"; @@ -248,7 +246,7 @@ public class OpenInterfaceGrpcServer { reply.setSuccess(cmd.getResult().isPassed()); try { - reply.putAttrs(OnapCommandConstants.RESULTS, gson.fromJson(printOut,String.class)); + reply.putAttrs(OnapCommandConstants.RESULTS, new JsonParser().parse(printOut).toString()); } catch (Exception e) { // NOSONAR reply.putAttrs(OnapCommandConstants.RESULTS, printOut); } |