X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=netconf%2Fsal-netconf-connector%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fnetconf%2Fsal%2Fconnect%2Fnetconf%2Futil%2FNetconfMessageTransformUtil.java;h=100073ce83a95f0eaa2bf99635f2dc68323f3e6d;hb=2295d50e7212d80a9bc752f655fa66790ad45022;hp=80566edcf3013418db90864b59ba9a1666e9612b;hpb=4792cdf7f8fabb8fd8597fa3f922b6eceb3a634e;p=netconf.git diff --git a/netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/util/NetconfMessageTransformUtil.java b/netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/util/NetconfMessageTransformUtil.java index 80566edcf3..100073ce83 100644 --- a/netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/util/NetconfMessageTransformUtil.java +++ b/netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/util/NetconfMessageTransformUtil.java @@ -67,7 +67,7 @@ import org.slf4j.LoggerFactory; import org.w3c.dom.Document; import org.w3c.dom.Element; -public class NetconfMessageTransformUtil { +public final class NetconfMessageTransformUtil { private static final Logger LOG = LoggerFactory.getLogger(NetconfMessageTransformUtil.class); @@ -206,7 +206,7 @@ public class NetconfMessageTransformUtil { final String inputMsgId = input.getDocument().getDocumentElement().getAttribute(MESSAGE_ID_ATTR); final String outputMsgId = output.getDocument().getDocumentElement().getAttribute(MESSAGE_ID_ATTR); - if (inputMsgId.equals(outputMsgId) == false) { + if (!inputMsgId.equals(outputMsgId)) { final Map errorInfo = ImmutableMap.builder() .put("actual-message-id", outputMsgId) .put("expected-message-id", inputMsgId) @@ -312,8 +312,8 @@ public class NetconfMessageTransformUtil { } else { final Entry modifyOperation = operation.isPresent() ? new AbstractMap.SimpleEntry<>(NETCONF_OPERATION_QNAME, operation.get()) : null; - configContent = ImmutableNodes - .fromInstanceId(ctx, dataPath, lastChildOverride, Optional.fromNullable(modifyOperation)); + configContent = ImmutableNodes.fromInstanceId(ctx, dataPath, lastChildOverride.toJavaUtil(), + java.util.Optional.ofNullable(modifyOperation)); } final Element element = XmlUtil.createElement(BLANK_DOCUMENT, NETCONF_CONFIG_QNAME.getLocalName(), @@ -363,7 +363,8 @@ public class NetconfMessageTransformUtil { NetconfNotification.RFC3339_DATE_PARSER.apply(eventTimeElement.getTextContent()), notificationElement); } catch (final DocumentedException e) { - throw new IllegalArgumentException("Notification payload does not contain " + EVENT_TIME + " " + message); + throw new IllegalArgumentException("Notification payload does not contain " + EVENT_TIME + " " + message, + e); } catch (final DateTimeParseException e) { LOG.warn("Unable to parse event time from {}. Setting time to {}", eventTimeElement, NetconfNotification.UNKNOWN_EVENT_TIME, e);