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 d033785..800460c 100644 (file)
@@ -61,7 +61,7 @@ public abstract class AbstractDOMBrokerTransaction<T extends DOMStoreTransaction
         return ret;
     }
 
-    protected abstract T createTransaction(final LogicalDatastoreType key);
+    protected abstract T createTransaction(LogicalDatastoreType key);
 
     /**
      * Returns immutable Iterable of all subtransactions.
index 54f4e82..0fe26ed 100644 (file)
@@ -117,7 +117,8 @@ public abstract class AbstractDOMBrokerWriteTransaction<T extends DOMStoreWriteT
         Future<?> future;
         do {
             future = commitFuture;
-        } while (future == null);
+        }
+        while (future == null);
 
         return future.cancel(false);
     }
index 4728384..03d2a03 100644 (file)
@@ -134,8 +134,8 @@ abstract class AbstractClientHistory extends LocalAbortable implements Identifia
         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);
index 0ba6602..e6313d3 100644 (file)
@@ -530,16 +530,15 @@ abstract class AbstractProxyTransaction implements Identifiable<TransactionIdent
 
     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();
 
index 7c2ddb0..d7e3c65 100644 (file)
@@ -106,5 +106,5 @@ abstract class AbstractFrontendHistory implements Identifiable<LocalHistoryIdent
     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 e4dd00b..16c180e 100644 (file)
@@ -108,8 +108,8 @@ abstract class FrontendTransaction implements Identifiable<TransactionIdentifier
     }
 
     // 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()) {
index d5d129f..b3dc07b 100644 (file)
@@ -259,7 +259,7 @@ public class Shard extends RaftActor {
     @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(),
index 291cca0..87a0c8d 100644 (file)
@@ -22,5 +22,5 @@ interface ShardDataChangeListenerPublisher extends ShardDataTreeNotificationPubl
     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 e51b81c..30b7eaf 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);
 
-    void publishChanges(final DataTreeCandidate candidate, String logContext);
+    void publishChanges(DataTreeCandidate candidate, String logContext);
 }
index 1d9b58f..190c815 100644 (file)
@@ -35,7 +35,7 @@ abstract class AbstractVersionedShardDataTreeSnapshot extends ShardDataTreeSnaps
         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);
@@ -94,7 +94,7 @@ abstract class AbstractVersionedShardDataTreeSnapshot extends ShardDataTreeSnaps
 
     @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);
index b8cf731..c2a8733 100644 (file)
@@ -174,7 +174,7 @@ public final class DataTreeCandidateInputOutput {
     }
 
     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();
index 7b8382e..e82ddb6 100644 (file)
@@ -50,7 +50,7 @@ public abstract class ShardDataTreeSnapshot {
         }
 
         try {
-            try (final InputStream is = new ByteArrayInputStream(bytes)) {
+            try (InputStream is = new ByteArrayInputStream(bytes)) {
                 return deserialize(is);
             }
         } catch (IOException e) {
@@ -60,7 +60,7 @@ public abstract class ShardDataTreeSnapshot {
     }
 
     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
@@ -81,7 +81,7 @@ public abstract class ShardDataTreeSnapshot {
      */
     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) {
index 0352db6..20ecb0c 100644 (file)
@@ -86,7 +86,7 @@ public class DataTreeCohortIntegrationTest {
         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);
@@ -122,7 +122,7 @@ public class DataTreeCohortIntegrationTest {
 
         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
@@ -157,7 +157,7 @@ public class DataTreeCohortIntegrationTest {
         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
index 1b885c4..f8a7081 100644 (file)
@@ -685,7 +685,7 @@ public class DistributedDataStoreIntegrationTest {
 
                     // Create the write Tx.
 
-                    try (final DOMStoreWriteTransaction writeTx = writeOnly ? dataStore.newWriteOnlyTransaction()
+                    try (DOMStoreWriteTransaction writeTx = writeOnly ? dataStore.newWriteOnlyTransaction()
                             : dataStore.newReadWriteTransaction()) {
                         assertNotNull("newReadWriteTransaction returned null", writeTx);
 
index 923ec5a..8a4069e 100644 (file)
@@ -106,7 +106,7 @@ public class DistributedDataStoreTest extends AbstractActorTest {
 
     @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();

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.