Do not instantiate JsonParser 44/99644/1
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 8 Feb 2022 09:27:51 +0000 (10:27 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Tue, 8 Feb 2022 09:27:51 +0000 (10:27 +0100)
Use parseString() static method instead of using the deprecated instance
method.

Change-Id: Ica84e1d21bbb229b800a89fd11ce53d61f077883
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
applications/southbound-cli/src/main/java/org/opendaylight/openflowplugin/applications/southboundcli/cli/GetReconciliationStateProvider.java

index 587f7d9666a4ce567d845b8834b864bb9d11e880..fc702852fe54742dee0a1d1b029bf88853205da1 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.applications.southboundcli.cli;
 
 import com.google.common.net.InetAddresses;
@@ -154,7 +153,7 @@ public class GetReconciliationStateProvider extends OsgiCommandSupport {
         try {
             String getReconcilationRemoteResponse = invokeRemoteRestOperation(ipAddress);
             if (getReconcilationRemoteResponse != null) {
-                JsonElement rootObj = new JsonParser().parse(getReconcilationRemoteResponse);
+                JsonElement rootObj = JsonParser.parseString(getReconcilationRemoteResponse);
                 String remoteJMXOperationResult = rootObj.getAsJsonObject().get("value").toString();
                 Type type = new TypeToken<HashMap<String, String>>() {}.getType();
                 jmxReconciliationStates.putAll(new Gson().fromJson(remoteJMXOperationResult, type));