Do not instantiate JsonParser
[netconf.git] / restconf / restconf-nb-bierman02 / src / main / java / org / opendaylight / netconf / sal / streams / listeners / NotificationListenerAdapter.java
index 2ea58c064e51812f12aa173eb2ce0767d1c49ccb..012b6f7d84dae4ad45fe941a9cba9c185e27039e 100644 (file)
@@ -131,9 +131,8 @@ public class NotificationListenerAdapter extends AbstractCommonSubscriber implem
      */
     @VisibleForTesting
     String prepareJson(final EffectiveModelContext schemaContext, final DOMNotification notification) {
-        final JsonParser jsonParser = new JsonParser();
         final JsonObject json = new JsonObject();
-        json.add("ietf-restconf:notification", jsonParser.parse(writeBodyToString(schemaContext, notification)));
+        json.add("ietf-restconf:notification", JsonParser.parseString(writeBodyToString(schemaContext, notification)));
         json.addProperty("event-time", ListenerAdapter.toRFC3339(Instant.now()));
         return json.toString();
     }