Code Review
/
netconf.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Do not instantiate JsonParser
[netconf.git]
/
restconf
/
restconf-nb-bierman02
/
src
/
main
/
java
/
org
/
opendaylight
/
netconf
/
sal
/
streams
/
listeners
/
NotificationListenerAdapter.java
diff --git
a/restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/streams/listeners/NotificationListenerAdapter.java
b/restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/streams/listeners/NotificationListenerAdapter.java
index 2ea58c064e51812f12aa173eb2ce0767d1c49ccb..012b6f7d84dae4ad45fe941a9cba9c185e27039e 100644
(file)
--- a/
restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/streams/listeners/NotificationListenerAdapter.java
+++ b/
restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/streams/listeners/NotificationListenerAdapter.java
@@
-131,9
+131,8
@@
public class NotificationListenerAdapter extends AbstractCommonSubscriber implem
*/
@VisibleForTesting
String prepareJson(final EffectiveModelContext schemaContext, final DOMNotification notification) {
*/
@VisibleForTesting
String prepareJson(final EffectiveModelContext schemaContext, final DOMNotification notification) {
- final JsonParser jsonParser = new JsonParser();
final JsonObject json = new JsonObject();
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();
}
json.addProperty("event-time", ListenerAdapter.toRFC3339(Instant.now()));
return json.toString();
}