X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=netconf%2Fmdsal-netconf-connector%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fnetconf%2Fmdsal%2Fconnector%2Fops%2FRuntimeRpc.java;h=d61c249cfd2df18181cba3d8fe01ba3d89a2d98b;hb=47c1b8e3d9835d336c79d6b4ca4e61417a05039e;hp=00d9b81e4a729870c9c54efc24500e1df0e6d1a6;hpb=a6793f380da6bb5ce475e00ade84a973c64b001c;p=netconf.git diff --git a/netconf/mdsal-netconf-connector/src/main/java/org/opendaylight/netconf/mdsal/connector/ops/RuntimeRpc.java b/netconf/mdsal-netconf-connector/src/main/java/org/opendaylight/netconf/mdsal/connector/ops/RuntimeRpc.java index 00d9b81e4a..d61c249cfd 100644 --- a/netconf/mdsal-netconf-connector/src/main/java/org/opendaylight/netconf/mdsal/connector/ops/RuntimeRpc.java +++ b/netconf/mdsal-netconf-connector/src/main/java/org/opendaylight/netconf/mdsal/connector/ops/RuntimeRpc.java @@ -9,7 +9,6 @@ package org.opendaylight.netconf.mdsal.connector.ops; import com.google.common.base.Optional; -import com.google.common.base.Throwables; import com.google.common.util.concurrent.CheckedFuture; import java.io.IOException; import java.net.URI; @@ -107,8 +106,7 @@ public class RuntimeRpc extends AbstractSingletonNetconfOperation { //this returns module with the newest revision if more then 1 module with same namespace is found private Optional getModule(final URI namespaceURI) { - return Optional.fromNullable( - schemaContext.getCurrentContext().findModuleByNamespaceAndRevision(namespaceURI, null)); + return Optional.fromJavaUtil(schemaContext.getCurrentContext().findModule(namespaceURI)); } private static Optional getRpcDefinitionFromModule(final Module module, final URI namespaceURI, @@ -132,7 +130,7 @@ public class RuntimeRpc extends AbstractSingletonNetconfOperation { netconfOperationNamespace = operationElement.getNamespace(); } catch (final DocumentedException e) { LOG.debug("Cannot retrieve netconf operation namespace from message due to ", e); - throw new DocumentedException("Cannot retrieve netconf operation namespace from message", + throw new DocumentedException("Cannot retrieve netconf operation namespace from message", e, ErrorType.PROTOCOL, ErrorTag.UNKNOWN_NAMESPACE, ErrorSeverity.ERROR); } @@ -246,7 +244,7 @@ public class RuntimeRpc extends AbstractSingletonNetconfOperation { nnWriter.flush(); xmlWriter.flush(); } catch (XMLStreamException | IOException e) { - Throwables.propagate(e); + throw new RuntimeException(e); } } @@ -261,7 +259,7 @@ public class RuntimeRpc extends AbstractSingletonNetconfOperation { @Nullable private NormalizedNode rpcToNNode(final XmlElement element, @Nullable final ContainerSchemaNode input) throws DocumentedException { - if (input.getChildNodes().isEmpty()) { + if (input == null || input.getChildNodes().isEmpty()) { return null; }