Merge "Bump to yangtools-2.1.4 and mdsal-3.0.2"
authorAnil Belur <abelur@linuxfoundation.org>
Sat, 1 Dec 2018 07:18:26 +0000 (07:18 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Sat, 1 Dec 2018 07:18:26 +0000 (07:18 +0000)
features/pom.xml
netconf/callhome-protocol/src/main/java/org/opendaylight/netconf/callhome/protocol/NetconfCallHomeServer.java
netconf/models/pom.xml
netconf/netconf-tcp/src/main/java/org/opendaylight/netconf/tcp/netty/ProxyServer.java
netconf/pom.xml
pom.xml
restconf/pom.xml
restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/restconf/impl/RestconfImpl.java
restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/streams/websockets/WebSocketServer.java
restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/streams/websockets/WebSocketServer.java

index 1233ce1df875b3b406291d15d3314a5a8a7f1a97..fd4ca55ccd512686504a4269b64dcbcf8ab36734 100644 (file)
   <version>1.6.0-SNAPSHOT</version>
   <packaging>pom</packaging>
 
+  <properties>
+    <maven.deploy.skip>true</maven.deploy.skip>
+    <maven.install.skip>true</maven.install.skip>
+  </properties>
+
   <modules>
     <module>netconf</module>
     <module>netconf-connector</module>
index 62b37ddb72babba6d0e86004d79e4b6cc691c960..c519d2bb7b30ab504880a30099ae78d2fb4cf931 100644 (file)
@@ -180,7 +180,7 @@ public class NetconfCallHomeServer implements AutoCloseable, ServerKeyVerifier {
             client.start();
             acceptor.bind(bindAddress);
         } catch (IOException e) {
-            LOG.error("Unable to start NETCONF CallHome Service", e);
+            LOG.error("Unable to start NETCONF CallHome Service on {}", bindAddress, e);
             throw e;
         }
     }
index 855497d754f6f200d08d4cf2fde5e0faf0d77966..7511a34587c74fa6b9baee21279b3dcbfe73d5a1 100644 (file)
   <packaging>pom</packaging>
   <name>${project.artifactId}</name>
 
+  <properties>
+    <maven.deploy.skip>true</maven.deploy.skip>
+    <maven.install.skip>true</maven.install.skip>
+  </properties>
+
   <modules>
     <module>ietf-netconf</module>
     <module>ietf-netconf-monitoring</module>
index feabd71cf079bfa333fb9d66d1200f830ce4c6dc..9e5e175654922aca8e62c794f467c38a809ab475 100644 (file)
@@ -21,12 +21,17 @@ import io.netty.channel.socket.nio.NioServerSocketChannel;
 import io.netty.handler.logging.LogLevel;
 import io.netty.handler.logging.LoggingHandler;
 import java.net.InetSocketAddress;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class ProxyServer implements AutoCloseable {
+    private static final Logger LOG = LoggerFactory.getLogger(ProxyServer.class);
+
     private final EventLoopGroup bossGroup = new NioEventLoopGroup();
     private final EventLoopGroup workerGroup = new NioEventLoopGroup();
     private final ChannelFuture channelFuture;
 
+    @SuppressWarnings("checkstyle:IllegalCatch")
     public ProxyServer(InetSocketAddress address, final LocalAddress localAddress) {
         // Configure the server.
         final Bootstrap clientBootstrap = new Bootstrap();
@@ -44,7 +49,13 @@ public class ProxyServer implements AutoCloseable {
                 });
 
         // Start the server.
-        channelFuture = serverBootstrap.bind(address).syncUninterruptibly();
+        try {
+            channelFuture = serverBootstrap.bind(address).syncUninterruptibly();
+        } catch (Throwable throwable) {
+            // sync() re-throws exceptions declared as Throwable, so the compiler doesn't see them
+            LOG.error("Error while binding to address {}", address, throwable);
+            throw throwable;
+        }
     }
 
     @Override
index e4f4fb379e4067d3adef5ad62a12a8d9f85a1baf..cef01f3e81787a90b79b1e481e36fd365e03d28a 100644 (file)
   <packaging>pom</packaging>
   <name>${project.artifactId}</name>
 
+  <properties>
+    <maven.deploy.skip>true</maven.deploy.skip>
+    <maven.install.skip>true</maven.install.skip>
+  </properties>
+
   <modules>
     <module>netconf-api</module>
     <module>netconf-config</module>
diff --git a/pom.xml b/pom.xml
index 591144c3c2e3ae147538fd7785a0acf235547dac..e465c4252d7a9c1cd926be141048eff8c0071e0c 100644 (file)
--- a/pom.xml
+++ b/pom.xml
     <packaging>pom</packaging>
     <name>${project.artifactId}</name>
 
+    <properties>
+        <maven.deploy.skip>true</maven.deploy.skip>
+        <maven.install.skip>true</maven.install.skip>
+    </properties>
+
     <modules>
         <module>features</module>
         <module>karaf</module>
         <module>restconf</module>
     </modules>
 
+    <profiles>
+        <profile>
+            <id>sonar-jacoco-aggregate</id>
+            <activation>
+                <property>
+                    <name>odl.jacoco.aggregateFile</name>
+                </property>
+            </activation>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.jacoco</groupId>
+                        <artifactId>jacoco-maven-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <id>merge</id>
+                                <goals>
+                                    <goal>merge</goal>
+                                </goals>
+                                <phase>generate-resources</phase>
+                                <configuration>
+                                    <destFile>${odl.jacoco.aggregateFile}</destFile>
+                                    <fileSets>
+                                        <fileSet>
+                                            <directory>${project.basedir}</directory>
+                                            <includes>
+                                                <include>**/target/code-coverage/*.exec</include>
+                                            </includes>
+                                        </fileSet>
+                                    </fileSets>
+                                </configuration>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
 </project>
index c2f1fe2f2425f0efac2d74070a956f6d179839d0..2eb997769584b8e97f2f3e3564af32f813bfacb9 100644 (file)
     <packaging>pom</packaging>
     <name>${project.artifactId}</name>
 
+    <properties>
+        <maven.deploy.skip>true</maven.deploy.skip>
+        <maven.install.skip>true</maven.install.skip>
+    </properties>
+
     <modules>
         <module>restconf-parent</module>
         <module>restconf-artifacts</module>
index 0276d558d960fcf4f92c2660d21d559b8830c1da..95010cff19a18baef51440411ac18610a3dbc248 100644 (file)
@@ -1394,7 +1394,7 @@ public final class RestconfImpl implements RestconfService {
         return listModuleBuilder.build();
     }
 
-    protected MapEntryNode toModuleEntryNode(final Module module, final DataSchemaNode moduleSchemaNode) {
+    private MapEntryNode toModuleEntryNode(final Module module, final DataSchemaNode moduleSchemaNode) {
         Preconditions.checkArgument(moduleSchemaNode instanceof ListSchemaNode,
                 "moduleSchemaNode has to be of type ListSchemaNode");
         final ListSchemaNode listModuleSchemaNode = (ListSchemaNode) moduleSchemaNode;
@@ -1408,22 +1408,22 @@ public final class RestconfImpl implements RestconfService {
         moduleNodeValues
                 .withChild(Builders.leafBuilder((LeafSchemaNode) nameSchemaNode).withValue(module.getName()).build());
 
+        final QNameModule qNameModule = module.getQNameModule();
+
         instanceDataChildrenByName =
                 ControllerContext.findInstanceDataChildrenByName(listModuleSchemaNode, "revision");
         final DataSchemaNode revisionSchemaNode = Iterables.getFirst(instanceDataChildrenByName, null);
         Preconditions.checkState(revisionSchemaNode instanceof LeafSchemaNode);
-        final java.util.Optional<Revision> revision = module.getQNameModule().getRevision();
-        if (revision.isPresent()) {
-            moduleNodeValues.withChild(Builders.leafBuilder((LeafSchemaNode) revisionSchemaNode)
-                .withValue(revision.get().toString()).build());
-        }
+        final java.util.Optional<Revision> revision = qNameModule.getRevision();
+        moduleNodeValues.withChild(Builders.leafBuilder((LeafSchemaNode) revisionSchemaNode)
+                .withValue(revision.map(Revision::toString).orElse("")).build());
 
         instanceDataChildrenByName =
                 ControllerContext.findInstanceDataChildrenByName(listModuleSchemaNode, "namespace");
         final DataSchemaNode namespaceSchemaNode = Iterables.getFirst(instanceDataChildrenByName, null);
         Preconditions.checkState(namespaceSchemaNode instanceof LeafSchemaNode);
         moduleNodeValues.withChild(Builders.leafBuilder((LeafSchemaNode) namespaceSchemaNode)
-                .withValue(module.getNamespace().toString()).build());
+                .withValue(qNameModule.getNamespace().toString()).build());
 
         instanceDataChildrenByName =
                 ControllerContext.findInstanceDataChildrenByName(listModuleSchemaNode, "feature");
index b8093dcb7a38077f6da9a2646ab5e493f4434f3a..68612749ae65de79f2b1b734f5999c45cd6d348e 100644 (file)
@@ -107,6 +107,7 @@ public final class WebSocketServer implements Runnable {
     }
 
     @Override
+    @SuppressWarnings("checkstyle:IllegalCatch")
     public void run() {
         bossGroup = new NioEventLoopGroup();
         workerGroup = new NioEventLoopGroup();
@@ -121,6 +122,10 @@ public final class WebSocketServer implements Runnable {
             channel.closeFuture().sync();
         } catch (final InterruptedException e) {
             LOG.error("Web socket server encountered an error during startup attempt on port {}", port, e);
+        } catch (Throwable throwable) {
+            // sync() re-throws exceptions declared as Throwable, so the compiler doesn't see them
+            LOG.error("Error while binding to address {}, port {}", address, port, throwable);
+            throw throwable;
         } finally {
             stop();
         }
index 029cb27f78672c465cf247520b800d8a306d0953..54b11e040e4a1c1102447a3b2f7713de4d2e1c6b 100644 (file)
@@ -82,6 +82,7 @@ public final class WebSocketServer implements Runnable {
     }
 
     @Override
+    @SuppressWarnings("checkstyle:IllegalCatch")
     public void run() {
         bossGroup = new NioEventLoopGroup();
         workerGroup = new NioEventLoopGroup();
@@ -96,6 +97,10 @@ public final class WebSocketServer implements Runnable {
             channel.closeFuture().sync();
         } catch (final InterruptedException e) {
             LOG.error("Web socket server encountered an error during startup attempt on port {}", port, e);
+        } catch (Throwable throwable) {
+            // sync() re-throws exceptions declared as Throwable, so the compiler doesn't see them
+            LOG.error("Error while binding to port {}", port, throwable);
+            throw throwable;
         } finally {
             stop();
         }