sal-distributed-datastore Checkstyle fixes (for next version) 89/51389/4
authorMichael Vorburger <vorburger@redhat.com>
Fri, 3 Feb 2017 10:58:51 +0000 (11:58 +0100)
committerTom Pantelis <tpanteli@brocade.com>
Wed, 15 Feb 2017 14:17:11 +0000 (14:17 +0000)
Even though sal-distributed-datastore currentla already has CS
enforcement, these violations don't show up in the build, but I see them
as red in Eclipse; I think this must be becaues the CS version used in
the Eclipse plugin-in is more recent than the CS used in odlparent, and
one of the existing activated checks got a little more stringent.

Cleaning this up thus helps both to (a) not have read in Eclipse; (b)
pave the way to upgrade Checkstyle in odlparent some day.

Change-Id: Ib5649a95a1b26b5791f2c3f3f83924b569f965a2
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
16 files changed:
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/AbstractDOMBrokerTransaction.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/AbstractDOMBrokerWriteTransaction.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/AbstractClientHistory.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/AbstractDataStoreClientBehavior.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/AbstractProxyTransaction.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/AbstractFrontendHistory.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/FrontendTransaction.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/Shard.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ShardDataChangeListenerPublisher.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ShardDataTreeNotificationPublisher.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/persisted/AbstractVersionedShardDataTreeSnapshot.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/persisted/DataTreeCandidateInputOutput.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/persisted/ShardDataTreeSnapshot.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DataTreeCohortIntegrationTest.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DistributedDataStoreIntegrationTest.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DistributedDataStoreTest.java

index d03378558838c985765c56bdf1e7edb8061fb446..800460c712a16f16a6471b927da9fddabbe99bf2 100644 (file)
@@ -61,7 +61,7 @@ public abstract class AbstractDOMBrokerTransaction<T extends DOMStoreTransaction
         return ret;
     }
 
         return ret;
     }
 
-    protected abstract T createTransaction(final LogicalDatastoreType key);
+    protected abstract T createTransaction(LogicalDatastoreType key);
 
     /**
      * Returns immutable Iterable of all subtransactions.
 
     /**
      * Returns immutable Iterable of all subtransactions.
index 54f4e825d012a98bda5b739d52e407003b6a5de6..0fe26ed48dae5d8b68dc41f22c617ea78d3da8bd 100644 (file)
@@ -117,7 +117,8 @@ public abstract class AbstractDOMBrokerWriteTransaction<T extends DOMStoreWriteT
         Future<?> future;
         do {
             future = commitFuture;
         Future<?> future;
         do {
             future = commitFuture;
-        } while (future == null);
+        }
+        while (future == null);
 
         return future.cancel(false);
     }
 
         return future.cancel(false);
     }
index 47283843d478401a2b72275e6ea87ca3347a0fcc..03d2a0377f83050c031202e64b096e39f006e41a 100644 (file)
@@ -134,8 +134,8 @@ abstract class AbstractClientHistory extends LocalAbortable implements Identifia
         return ret;
     }
 
         return ret;
     }
 
-    abstract ProxyHistory createHistoryProxy(final LocalHistoryIdentifier historyId,
-            final AbstractClientConnection<ShardBackendInfo> connection);
+    abstract ProxyHistory createHistoryProxy(LocalHistoryIdentifier historyId,
+            AbstractClientConnection<ShardBackendInfo> connection);
 
     private void createHistoryCallback(final Response<?, ?> response) {
         LOG.debug("Create history response {}", response);
 
     private void createHistoryCallback(final Response<?, ?> response) {
         LOG.debug("Create history response {}", response);
index 9af88a8a5a7b9c8a3070ad5f24ae9a6ce06b3a20..ef5590fe84354bda48b7a3a300881825dfc56e3a 100644 (file)
@@ -215,5 +215,5 @@ abstract class AbstractDataStoreClientBehavior extends ClientActorBehavior<Shard
         context().executeInActor(this::shutdown);
     }
 
         context().executeInActor(this::shutdown);
     }
 
-    abstract Long resolveShardForPath(final YangInstanceIdentifier path);
+    abstract Long resolveShardForPath(YangInstanceIdentifier path);
 }
 }
index 0ba660234a15cee42c84f1c00b61d2ad2ef244e6..e6313d3cfd68f052b9e51582ac6e280983b92b99 100644 (file)
@@ -530,16 +530,15 @@ abstract class AbstractProxyTransaction implements Identifiable<TransactionIdent
 
     abstract boolean isSnapshotOnly();
 
 
     abstract boolean isSnapshotOnly();
 
-    abstract void doDelete(final YangInstanceIdentifier path);
+    abstract void doDelete(YangInstanceIdentifier path);
 
 
-    abstract void doMerge(final YangInstanceIdentifier path, final NormalizedNode<?, ?> data);
+    abstract void doMerge(YangInstanceIdentifier path, NormalizedNode<?, ?> data);
 
 
-    abstract void doWrite(final YangInstanceIdentifier path, final NormalizedNode<?, ?> data);
+    abstract void doWrite(YangInstanceIdentifier path, NormalizedNode<?, ?> data);
 
 
-    abstract CheckedFuture<Boolean, ReadFailedException> doExists(final YangInstanceIdentifier path);
+    abstract CheckedFuture<Boolean, ReadFailedException> doExists(YangInstanceIdentifier path);
 
 
-    abstract CheckedFuture<Optional<NormalizedNode<?, ?>>, ReadFailedException> doRead(
-            final YangInstanceIdentifier path);
+    abstract CheckedFuture<Optional<NormalizedNode<?, ?>>, ReadFailedException> doRead(YangInstanceIdentifier path);
 
     abstract void doSeal();
 
 
     abstract void doSeal();
 
index 7c2ddb05b22ba07fba5503615c723b90d38681c4..d7e3c6533f901b443becfefdf3302ac6cb74d3cc 100644 (file)
@@ -106,5 +106,5 @@ abstract class AbstractFrontendHistory implements Identifiable<LocalHistoryIdent
     abstract FrontendTransaction createReadyTransaction(TransactionIdentifier id, DataTreeModification mod)
         throws RequestException;
 
     abstract FrontendTransaction createReadyTransaction(TransactionIdentifier id, DataTreeModification mod)
         throws RequestException;
 
-    abstract ShardDataTreeCohort createReadyCohort(final TransactionIdentifier id, final DataTreeModification mod);
+    abstract ShardDataTreeCohort createReadyCohort(TransactionIdentifier id, DataTreeModification mod);
 }
 }
index e4dd00b602f23fccf578f698c349e3ab9888c103..16c180e4ed9bde26a905654bc730a1e3064de825 100644 (file)
@@ -108,8 +108,8 @@ abstract class FrontendTransaction implements Identifiable<TransactionIdentifier
     }
 
     // Sequence has already been checked
     }
 
     // Sequence has already been checked
-    abstract @Nullable TransactionSuccess<?> handleRequest(final TransactionRequest<?> request,
-            final RequestEnvelope envelope, final long now) throws RequestException;
+    abstract @Nullable TransactionSuccess<?> handleRequest(TransactionRequest<?> request,
+            RequestEnvelope envelope, long now) throws RequestException;
 
     private void recordResponse(final long sequence, final Object response) {
         if (replayQueue.isEmpty()) {
 
     private void recordResponse(final long sequence, final Object response) {
         if (replayQueue.isEmpty()) {
index d5d129f22172cb392657de55360812014dbb7cae..b3dc07b0e5c3128d25375cd8d209e906c1a29596 100644 (file)
@@ -259,7 +259,7 @@ public class Shard extends RaftActor {
     @SuppressWarnings("checkstyle:IllegalCatch")
     @Override
     protected void handleNonRaftCommand(final Object message) {
     @SuppressWarnings("checkstyle:IllegalCatch")
     @Override
     protected void handleNonRaftCommand(final Object message) {
-        try (final MessageTracker.Context context = appendEntriesReplyTracker.received(message)) {
+        try (MessageTracker.Context context = appendEntriesReplyTracker.received(message)) {
             final Optional<Error> maybeError = context.error();
             if (maybeError.isPresent()) {
                 LOG.trace("{} : AppendEntriesReply failed to arrive at the expected interval {}", persistenceId(),
             final Optional<Error> maybeError = context.error();
             if (maybeError.isPresent()) {
                 LOG.trace("{} : AppendEntriesReply failed to arrive at the expected interval {}", persistenceId(),
index 291cca0313bdc4fc724dd59581a41428d46254a2..87a0c8d64bef09c18676eaca5e0e472c041fe523 100644 (file)
@@ -22,5 +22,5 @@ interface ShardDataChangeListenerPublisher extends ShardDataTreeNotificationPubl
     ShardDataChangeListenerPublisher newInstance();
 
     <L extends AsyncDataChangeListener<YangInstanceIdentifier, NormalizedNode<?, ?>>> DataChangeListenerRegistration<L>
     ShardDataChangeListenerPublisher newInstance();
 
     <L extends AsyncDataChangeListener<YangInstanceIdentifier, NormalizedNode<?, ?>>> DataChangeListenerRegistration<L>
-            registerDataChangeListener(final YangInstanceIdentifier path,final L listener, final DataChangeScope scope);
+            registerDataChangeListener(YangInstanceIdentifier path, L listener, DataChangeScope scope);
 }
 }
index e51b81cc94f91498f7d5c495a012cf6154790791..30b7eaf2ae5f8e5e29a843f01aeafecdbd41c1bf 100644 (file)
@@ -18,5 +18,5 @@ import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeCandidate;
 interface ShardDataTreeNotificationPublisher {
     long PUBLISH_DELAY_THRESHOLD_IN_MS = TimeUnit.MILLISECONDS.convert(1, TimeUnit.SECONDS);
 
 interface ShardDataTreeNotificationPublisher {
     long PUBLISH_DELAY_THRESHOLD_IN_MS = TimeUnit.MILLISECONDS.convert(1, TimeUnit.SECONDS);
 
-    void publishChanges(final DataTreeCandidate candidate, String logContext);
+    void publishChanges(DataTreeCandidate candidate, String logContext);
 }
 }
index 1d9b58f27049046fdee8f62d2e690e2344439821..190c815dd3508b69549f9ca9d50c6edc1027a829 100644 (file)
@@ -35,7 +35,7 @@ abstract class AbstractVersionedShardDataTreeSnapshot extends ShardDataTreeSnaps
         switch (version) {
             case BORON:
                 // Boron snapshots use Java Serialization
         switch (version) {
             case BORON:
                 // Boron snapshots use Java Serialization
-                try (final ObjectInputStream ois = new ObjectInputStream(is)) {
+                try (ObjectInputStream ois = new ObjectInputStream(is)) {
                     return (ShardDataTreeSnapshot) ois.readObject();
                 } catch (ClassNotFoundException e) {
                     LOG.error("Failed to serialize data tree snapshot", e);
                     return (ShardDataTreeSnapshot) ois.readObject();
                 } catch (ClassNotFoundException e) {
                     LOG.error("Failed to serialize data tree snapshot", e);
@@ -94,7 +94,7 @@ abstract class AbstractVersionedShardDataTreeSnapshot extends ShardDataTreeSnaps
 
     @Override
     public void serialize(final OutputStream os) throws IOException {
 
     @Override
     public void serialize(final OutputStream os) throws IOException {
-        try (final DataOutputStream dos = new DataOutputStream(os)) {
+        try (DataOutputStream dos = new DataOutputStream(os)) {
             final PayloadVersion version = version();
             version.writeTo(dos);
             versionedSerialize(dos, version);
             final PayloadVersion version = version();
             version.writeTo(dos);
             versionedSerialize(dos, version);
index b8cf731b9460be2d8444449c2eb57c910d16dfea..c2a873331d3d0e61f14c8c2b0faec18950f43507 100644 (file)
@@ -174,7 +174,7 @@ public final class DataTreeCandidateInputOutput {
     }
 
     public static void writeDataTreeCandidate(final DataOutput out, DataTreeCandidate candidate) throws IOException {
     }
 
     public static void writeDataTreeCandidate(final DataOutput out, DataTreeCandidate candidate) throws IOException {
-        try (final NormalizedNodeDataOutput writer = NormalizedNodeInputOutput.newDataOutput(out)) {
+        try (NormalizedNodeDataOutput writer = NormalizedNodeInputOutput.newDataOutput(out)) {
             writer.writeYangInstanceIdentifier(candidate.getRootPath());
 
             final DataTreeCandidateNode node = candidate.getRootNode();
             writer.writeYangInstanceIdentifier(candidate.getRootPath());
 
             final DataTreeCandidateNode node = candidate.getRootNode();
index 7b8382e9c2536bf44b6dea553e8b81f5c855aeeb..e82ddb6d7624b41c1966df24a9d6a7093bca457f 100644 (file)
@@ -50,7 +50,7 @@ public abstract class ShardDataTreeSnapshot {
         }
 
         try {
         }
 
         try {
-            try (final InputStream is = new ByteArrayInputStream(bytes)) {
+            try (InputStream is = new ByteArrayInputStream(bytes)) {
                 return deserialize(is);
             }
         } catch (IOException e) {
                 return deserialize(is);
             }
         } catch (IOException e) {
@@ -60,7 +60,7 @@ public abstract class ShardDataTreeSnapshot {
     }
 
     public static ShardDataTreeSnapshot deserialize(final InputStream is) throws IOException {
     }
 
     public static ShardDataTreeSnapshot deserialize(final InputStream is) throws IOException {
-        try (final DataInputStream dis = new DataInputStream(is)) {
+        try (DataInputStream dis = new DataInputStream(is)) {
             final ShardDataTreeSnapshot ret = AbstractVersionedShardDataTreeSnapshot.deserialize(dis);
 
             // Make sure we consume all bytes, otherwise something went very wrong
             final ShardDataTreeSnapshot ret = AbstractVersionedShardDataTreeSnapshot.deserialize(dis);
 
             // Make sure we consume all bytes, otherwise something went very wrong
@@ -81,7 +81,7 @@ public abstract class ShardDataTreeSnapshot {
      */
     public abstract Optional<NormalizedNode<?, ?>> getRootNode();
 
      */
     public abstract Optional<NormalizedNode<?, ?>> getRootNode();
 
-    public abstract void serialize(final OutputStream os) throws IOException;
+    public abstract void serialize(OutputStream os) throws IOException;
 
     @Deprecated
     private static boolean isLegacyStream(final byte[] bytes) {
 
     @Deprecated
     private static boolean isLegacyStream(final byte[] bytes) {
index 0352db6f767282d8a92e0793391f2fbbfa82d8da..20ecb0c578e8dd55c7a1dd0af06dae08f1fd79c3 100644 (file)
@@ -86,7 +86,7 @@ public class DataTreeCohortIntegrationTest {
         ArgumentCaptor<DOMDataTreeCandidate> candidateCapt = ArgumentCaptor.forClass(DOMDataTreeCandidate.class);
         new IntegrationTestKit(getSystem(), datastoreContextBuilder) {
             {
         ArgumentCaptor<DOMDataTreeCandidate> candidateCapt = ArgumentCaptor.forClass(DOMDataTreeCandidate.class);
         new IntegrationTestKit(getSystem(), datastoreContextBuilder) {
             {
-                try (final AbstractDataStore dataStore = setupDistributedDataStore("transactionIntegrationTest",
+                try (AbstractDataStore dataStore = setupDistributedDataStore("transactionIntegrationTest",
                         "test-1")) {
                     final ObjectRegistration<DOMDataTreeCommitCohort> cohortReg =
                             dataStore.registerCommitCohort(TEST_ID, cohort);
                         "test-1")) {
                     final ObjectRegistration<DOMDataTreeCommitCohort> cohortReg =
                             dataStore.registerCommitCohort(TEST_ID, cohort);
@@ -122,7 +122,7 @@ public class DataTreeCohortIntegrationTest {
 
         new IntegrationTestKit(getSystem(), datastoreContextBuilder) {
             {
 
         new IntegrationTestKit(getSystem(), datastoreContextBuilder) {
             {
-                try (final AbstractDataStore dataStore =
+                try (AbstractDataStore dataStore =
                         setupDistributedDataStore("transactionIntegrationTest", "test-1")) {
                     dataStore.registerCommitCohort(TEST_ID, failedCohort);
                     Thread.sleep(1000); // Registration is asynchronous
                         setupDistributedDataStore("transactionIntegrationTest", "test-1")) {
                     dataStore.registerCommitCohort(TEST_ID, failedCohort);
                     Thread.sleep(1000); // Registration is asynchronous
@@ -157,7 +157,7 @@ public class DataTreeCohortIntegrationTest {
         Mockito.doReturn(ThreePhaseCommitStep.NOOP_ABORT_FUTURE).when(stepToAbort).abort();
         new IntegrationTestKit(getSystem(), datastoreContextBuilder) {
             {
         Mockito.doReturn(ThreePhaseCommitStep.NOOP_ABORT_FUTURE).when(stepToAbort).abort();
         new IntegrationTestKit(getSystem(), datastoreContextBuilder) {
             {
-                try (final AbstractDataStore dataStore =
+                try (AbstractDataStore dataStore =
                         setupDistributedDataStore("transactionIntegrationTest", "test-1")) {
                     dataStore.registerCommitCohort(TEST_ID, cohortToAbort);
                     Thread.sleep(1000); // Registration is asynchronous
                         setupDistributedDataStore("transactionIntegrationTest", "test-1")) {
                     dataStore.registerCommitCohort(TEST_ID, cohortToAbort);
                     Thread.sleep(1000); // Registration is asynchronous
index 1b885c467f2d9f428fd393d399b80b94fa73c478..f8a70816d76d912f919471cf6bc861a1f24d5cde 100644 (file)
@@ -685,7 +685,7 @@ public class DistributedDataStoreIntegrationTest {
 
                     // Create the write Tx.
 
 
                     // Create the write Tx.
 
-                    try (final DOMStoreWriteTransaction writeTx = writeOnly ? dataStore.newWriteOnlyTransaction()
+                    try (DOMStoreWriteTransaction writeTx = writeOnly ? dataStore.newWriteOnlyTransaction()
                             : dataStore.newReadWriteTransaction()) {
                         assertNotNull("newReadWriteTransaction returned null", writeTx);
 
                             : dataStore.newReadWriteTransaction()) {
                         assertNotNull("newReadWriteTransaction returned null", writeTx);
 
index 923ec5a01c56de5f589ee0a656d4c575e7bcd475..8a4069e2e6125357e202efb5c7efc5fdf5bc856b 100644 (file)
@@ -106,7 +106,7 @@ public class DistributedDataStoreTest extends AbstractActorTest {
 
     @Test
     public void testWaitTillReadyCountDown() {
 
     @Test
     public void testWaitTillReadyCountDown() {
-        try (final DistributedDataStore distributedDataStore = new DistributedDataStore(actorContext, UNKNOWN_ID)) {
+        try (DistributedDataStore distributedDataStore = new DistributedDataStore(actorContext, UNKNOWN_ID)) {
             doReturn(datastoreContext).when(actorContext).getDatastoreContext();
             doReturn(shardElectionTimeout).when(datastoreContext).getShardLeaderElectionTimeout();
             doReturn(FiniteDuration.apply(5000, TimeUnit.MILLISECONDS)).when(shardElectionTimeout).duration();
             doReturn(datastoreContext).when(actorContext).getDatastoreContext();
             doReturn(shardElectionTimeout).when(datastoreContext).getShardLeaderElectionTimeout();
             doReturn(FiniteDuration.apply(5000, TimeUnit.MILLISECONDS)).when(shardElectionTimeout).duration();