X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fnetconf%2Fnetconf-impl%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fnetconf%2Fimpl%2Fmapping%2Foperations%2FDefaultCommit.java;fp=opendaylight%2Fnetconf%2Fnetconf-impl%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fnetconf%2Fimpl%2Fmapping%2Foperations%2FDefaultCommit.java;h=d4545430b47834ae8604737a50762056fd712526;hp=d6940a1a453fcaaf14f4e6e30292f8dbc427256d;hb=3e20a64a21d5b7bced26b03108aedcd025dd8be6;hpb=8145513d5b6430d550a5bce27ba812086c7d1b00 diff --git a/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/mapping/operations/DefaultCommit.java b/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/mapping/operations/DefaultCommit.java index d6940a1a45..d4545430b4 100644 --- a/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/mapping/operations/DefaultCommit.java +++ b/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/mapping/operations/DefaultCommit.java @@ -64,14 +64,14 @@ public class DefaultCommit extends AbstractNetconfOperation { @Override public Document handle(Document requestMessage, NetconfOperationChainedExecution subsequentOperation) throws NetconfDocumentedException { - Preconditions.checkArgument(subsequentOperation.isExecutionTermination() == false, + Preconditions.checkArgument(!subsequentOperation.isExecutionTermination(), "Subsequent netconf operation expected by %s", this); if (isCommitWithoutNotification(requestMessage)) { logger.debug("Skipping commit notification"); } else { // Send commit notification if commit was not issued by persister - requestMessage = removePersisterAttributes(requestMessage); + removePersisterAttributes(requestMessage); Element cfgSnapshot = getConfigSnapshot(operationRouter); logger.debug("Config snapshot retrieved successfully {}", cfgSnapshot); notificationProducer.sendCommitNotification("ok", cfgSnapshot, cap.getCapabilities()); @@ -90,10 +90,8 @@ public class DefaultCommit extends AbstractNetconfOperation { return HandlingPriority.HANDLE_WITH_DEFAULT_PRIORITY.increasePriority(1); } - private Document removePersisterAttributes(Document message) { - final Element documentElement = message.getDocumentElement(); - documentElement.removeAttribute(NOTIFY_ATTR); - return message; + private void removePersisterAttributes(Document message) { + message.getDocumentElement().removeAttribute(NOTIFY_ATTR); } private boolean isCommitWithoutNotification(Document message) { @@ -108,9 +106,9 @@ public class DefaultCommit extends AbstractNetconfOperation { String attr = xmlElement.getAttribute(NOTIFY_ATTR); - if (attr == null || attr.equals("")) + if (attr == null || attr.equals("")){ return false; - else if (attr.equals(Boolean.toString(false))) { + } else if (attr.equals(Boolean.toString(false))) { logger.debug("Commit operation received with notify=false attribute {}", message); return true; } else {