From 3210ea4661796b13af0c0cbd8d1a4b4714be0030 Mon Sep 17 00:00:00 2001 From: Tom Pantelis Date: Thu, 1 Feb 2018 21:41:25 -0500 Subject: [PATCH] Enable checkstyle enforcement in openflowplugin-parent This covers all code sub-projects. Also removed checkstyle configurations in all sub-projects. Change-Id: Ib93f4abb41e97bc4c803cd54ad1c2ea56040d3db Signed-off-by: Tom Pantelis --- applications/bulk-o-matic/pom.xml | 11 ----------- applications/forwardingrules-manager/pom.xml | 16 ---------------- applications/lldp-speaker/pom.xml | 11 ----------- applications/notification-supplier/pom.xml | 11 ----------- applications/reconciliation-framework/pom.xml | 17 ----------------- applications/southbound-cli/pom.xml | 16 ---------------- applications/table-miss-enforcer/pom.xml | 11 ----------- .../topology/lldp/LLDPDiscoveryListener.java | 6 +++--- .../topology/lldp/LLDPLinkAger.java | 6 +++--- .../topology/lldp/LLDPLinkAgerTest.java | 5 +++-- applications/topology-manager/pom.xml | 12 ------------ libraries/pom.xml | 11 +---------- .../core/connection/ConnectionAdapterImpl.java | 11 +++-------- openflowplugin-api/pom.xml | 7 ------- openflowplugin-common/pom.xml | 7 ------- openflowplugin-impl/pom.xml | 7 ------- parent/pom.xml | 7 +++++++ 17 files changed, 20 insertions(+), 152 deletions(-) diff --git a/applications/bulk-o-matic/pom.xml b/applications/bulk-o-matic/pom.xml index 9cb413d972..c1dcd3a834 100644 --- a/applications/bulk-o-matic/pom.xml +++ b/applications/bulk-o-matic/pom.xml @@ -46,15 +46,4 @@ - - - - org.apache.maven.plugins - maven-checkstyle-plugin - - checkstyle.violationSeverity=error - - - - diff --git a/applications/forwardingrules-manager/pom.xml b/applications/forwardingrules-manager/pom.xml index 8bf861d8a1..ec05dd4dff 100644 --- a/applications/forwardingrules-manager/pom.xml +++ b/applications/forwardingrules-manager/pom.xml @@ -72,22 +72,6 @@ - - - - org.apache.felix - maven-bundle-plugin - - - org.apache.maven.plugins - maven-checkstyle-plugin - - checkstyle.violationSeverity=error - - - - - scm:git:ssh://git.opendaylight.org:29418/openflowplugin.git scm:git:ssh://git.opendaylight.org:29418/openflowplugin.git diff --git a/applications/lldp-speaker/pom.xml b/applications/lldp-speaker/pom.xml index d0650295a1..762a1ff51c 100644 --- a/applications/lldp-speaker/pom.xml +++ b/applications/lldp-speaker/pom.xml @@ -59,15 +59,4 @@ - - - - org.apache.maven.plugins - maven-checkstyle-plugin - - checkstyle.violationSeverity=error - - - - diff --git a/applications/notification-supplier/pom.xml b/applications/notification-supplier/pom.xml index 5658935a81..9b23bbcfd9 100644 --- a/applications/notification-supplier/pom.xml +++ b/applications/notification-supplier/pom.xml @@ -49,15 +49,4 @@ test - - - - org.apache.maven.plugins - maven-checkstyle-plugin - - checkstyle.violationSeverity=error - - - - diff --git a/applications/reconciliation-framework/pom.xml b/applications/reconciliation-framework/pom.xml index b0ab8f5f56..f19bf221a6 100644 --- a/applications/reconciliation-framework/pom.xml +++ b/applications/reconciliation-framework/pom.xml @@ -67,23 +67,6 @@ - - - - org.apache.maven.plugins - maven-checkstyle-plugin - - checkstyle.violationSeverity=error - - - - org.apache.felix - maven-bundle-plugin - - - - - scm:git:ssh://git.opendaylight.org:29418/openflowplugin.git scm:git:ssh://git.opendaylight.org:29418/openflowplugin.git diff --git a/applications/southbound-cli/pom.xml b/applications/southbound-cli/pom.xml index 4973cfebe6..0e6d4d5caa 100644 --- a/applications/southbound-cli/pom.xml +++ b/applications/southbound-cli/pom.xml @@ -67,20 +67,4 @@ - - - - org.apache.maven.plugins - maven-checkstyle-plugin - - checkstyle.violationSeverity=error - - - - org.apache.felix - maven-bundle-plugin - - - - diff --git a/applications/table-miss-enforcer/pom.xml b/applications/table-miss-enforcer/pom.xml index 1274f046c6..35205ebdd2 100644 --- a/applications/table-miss-enforcer/pom.xml +++ b/applications/table-miss-enforcer/pom.xml @@ -48,15 +48,4 @@ - - - - org.apache.maven.plugins - maven-checkstyle-plugin - - checkstyle.violationSeverity=error - - - - diff --git a/applications/topology-lldp-discovery/src/main/java/org/opendaylight/openflowplugin/applications/topology/lldp/LLDPDiscoveryListener.java b/applications/topology-lldp-discovery/src/main/java/org/opendaylight/openflowplugin/applications/topology/lldp/LLDPDiscoveryListener.java index f8132f87d3..36ab3c7d01 100644 --- a/applications/topology-lldp-discovery/src/main/java/org/opendaylight/openflowplugin/applications/topology/lldp/LLDPDiscoveryListener.java +++ b/applications/topology-lldp-discovery/src/main/java/org/opendaylight/openflowplugin/applications/topology/lldp/LLDPDiscoveryListener.java @@ -52,12 +52,12 @@ public class LLDPDiscoveryListener implements PacketProcessingListener { LOG.debug("Publish add event for link {}", ld); notificationService.publish(ld); } else { - LOG.trace("Skip publishing the add event for link because controller is non-owner of the " + - "node {}. Link : {}", nodeKey.getId().getValue(), ld); + LOG.trace("Skip publishing the add event for link because controller is non-owner of the " + + "node {}. Link : {}", nodeKey.getId().getValue(), ld); } } else { LOG.debug("LLDP packet ignored. Unable to extract node-key from source node-connector reference."); } } } -} \ No newline at end of file +} diff --git a/applications/topology-lldp-discovery/src/main/java/org/opendaylight/openflowplugin/applications/topology/lldp/LLDPLinkAger.java b/applications/topology-lldp-discovery/src/main/java/org/opendaylight/openflowplugin/applications/topology/lldp/LLDPLinkAger.java index 5c3cb23060..738ba0299e 100644 --- a/applications/topology-lldp-discovery/src/main/java/org/opendaylight/openflowplugin/applications/topology/lldp/LLDPLinkAger.java +++ b/applications/topology-lldp-discovery/src/main/java/org/opendaylight/openflowplugin/applications/topology/lldp/LLDPLinkAger.java @@ -18,16 +18,16 @@ import java.util.concurrent.ConcurrentHashMap; import javax.annotation.Nonnull; import org.opendaylight.controller.sal.binding.api.NotificationProviderService; import org.opendaylight.mdsal.eos.binding.api.EntityOwnershipService; -import org.opendaylight.openflowplugin.applications.topology.lldp.utils.LLDPDiscoveryUtils; import org.opendaylight.openflowplugin.api.openflow.configuration.ConfigurationListener; import org.opendaylight.openflowplugin.api.openflow.configuration.ConfigurationService; +import org.opendaylight.openflowplugin.applications.topology.lldp.utils.LLDPDiscoveryUtils; import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.topology.discovery.rev130819.LinkDiscovered; import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.topology.discovery.rev130819.LinkRemovedBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node; +import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.lldp.discovery.config.rev160511.TopologyLldpDiscoveryConfig; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node; -import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey; public class LLDPLinkAger implements ConfigurationListener, AutoCloseable { private static final Logger LOG = LoggerFactory.getLogger(LLDPLinkAger.class); diff --git a/applications/topology-lldp-discovery/src/test/java/org/opendaylight/openflowplugin/applications/topology/lldp/LLDPLinkAgerTest.java b/applications/topology-lldp-discovery/src/test/java/org/opendaylight/openflowplugin/applications/topology/lldp/LLDPLinkAgerTest.java index 387db0a7aa..2645cefde9 100644 --- a/applications/topology-lldp-discovery/src/test/java/org/opendaylight/openflowplugin/applications/topology/lldp/LLDPLinkAgerTest.java +++ b/applications/topology-lldp-discovery/src/test/java/org/opendaylight/openflowplugin/applications/topology/lldp/LLDPLinkAgerTest.java @@ -32,10 +32,10 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId; import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes; import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node; import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey; -import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.lldp.discovery.config.rev160511.NonZeroUint32Type; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.lldp.discovery.config.rev160511.TopologyLldpDiscoveryConfig; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.lldp.discovery.config.rev160511.TopologyLldpDiscoveryConfigBuilder; +import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -71,7 +71,8 @@ public class LLDPLinkAgerTest { lldpLinkAger = new LLDPLinkAger(getConfig(), notificationService, getConfigurationService(), eos); Mockito.when(link.getDestination()).thenReturn(new NodeConnectorRef( InstanceIdentifier.create(Nodes.class).child(Node.class, new NodeKey(new NodeId("openflow:1"))))); - Mockito.when(eos.getOwnershipState(Mockito.any(Entity.class))).thenReturn(Optional.of(EntityOwnershipState.IS_OWNER)); + Mockito.when(eos.getOwnershipState(Mockito.any(Entity.class))).thenReturn( + Optional.of(EntityOwnershipState.IS_OWNER)); } @Test diff --git a/applications/topology-manager/pom.xml b/applications/topology-manager/pom.xml index 763cc68e77..5ecfd8f06a 100644 --- a/applications/topology-manager/pom.xml +++ b/applications/topology-manager/pom.xml @@ -64,16 +64,4 @@ HEAD - - - - org.apache.maven.plugins - maven-checkstyle-plugin - - checkstyle.violationSeverity=error - - - - - diff --git a/libraries/pom.xml b/libraries/pom.xml index 4f317687c4..7afa1815b5 100644 --- a/libraries/pom.xml +++ b/libraries/pom.xml @@ -16,15 +16,6 @@ - org.apache.felix maven-bundle-plugin @@ -42,4 +33,4 @@ liblldp - \ No newline at end of file + diff --git a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/connection/ConnectionAdapterImpl.java b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/connection/ConnectionAdapterImpl.java index 3ea7a8d306..65729220b4 100644 --- a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/connection/ConnectionAdapterImpl.java +++ b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/connection/ConnectionAdapterImpl.java @@ -142,8 +142,8 @@ public class ConnectionAdapterImpl extends AbstractConnectionAdapterStatistics i if (alienMessageListener != null && alienMessageListener.onAlienMessage((OfHeader) message)) { LOG.debug("Alien message {} received", message.getImplementedInterface()); - } else if (outputManager == null || !outputManager.onMessage((OfHeader) message) || message instanceof - EchoOutput) { + } else if (outputManager == null || !outputManager.onMessage((OfHeader) message) + || message instanceof EchoOutput) { final RpcResponseKey key = createRpcResponseKey((OfHeader) message); final ResponseExpectedRpcListener listener = findRpcResponse(key); if (listener != null) { @@ -183,12 +183,7 @@ public class ConnectionAdapterImpl extends AbstractConnectionAdapterStatistics i versionDetector = (OFVersionDetector) channel.pipeline().get(PipelineHandlers.OF_VERSION_DETECTOR.name()); Preconditions.checkState(versionDetector != null); - new Thread(new Runnable() { - @Override - public void run() { - connectionReadyListener.onConnectionReady(); - } - }).start(); + new Thread(() -> connectionReadyListener.onConnectionReady()).start(); } @Override diff --git a/openflowplugin-api/pom.xml b/openflowplugin-api/pom.xml index 5993c647c8..693889d51a 100644 --- a/openflowplugin-api/pom.xml +++ b/openflowplugin-api/pom.xml @@ -17,13 +17,6 @@ org.apache.felix maven-bundle-plugin - - org.apache.maven.plugins - maven-checkstyle-plugin - - checkstyle.violationSeverity=error - - org.codehaus.mojo findbugs-maven-plugin diff --git a/openflowplugin-common/pom.xml b/openflowplugin-common/pom.xml index 1764fcbbe9..00be22ad1d 100644 --- a/openflowplugin-common/pom.xml +++ b/openflowplugin-common/pom.xml @@ -19,13 +19,6 @@ org.apache.felix maven-bundle-plugin - - org.apache.maven.plugins - maven-checkstyle-plugin - - checkstyle.violationSeverity=error - - org.codehaus.mojo findbugs-maven-plugin diff --git a/openflowplugin-impl/pom.xml b/openflowplugin-impl/pom.xml index f785e83ca0..94d49d6035 100644 --- a/openflowplugin-impl/pom.xml +++ b/openflowplugin-impl/pom.xml @@ -126,13 +126,6 @@ - - org.apache.maven.plugins - maven-checkstyle-plugin - - checkstyle.violationSeverity=error - - org.apache.felix maven-bundle-plugin diff --git a/parent/pom.xml b/parent/pom.xml index fd1617b898..9f360bfd17 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -77,6 +77,13 @@ + + org.apache.maven.plugins + maven-checkstyle-plugin + + checkstyle.violationSeverity=error + + org.codehaus.mojo build-helper-maven-plugin -- 2.36.6