Checkstyle: fix ParenPad violations 02/51402/2
authorLorand Jakab <lojakab@cisco.com>
Fri, 3 Feb 2017 13:44:55 +0000 (15:44 +0200)
committerLorand Jakab <lojakab@cisco.com>
Fri, 10 Feb 2017 16:00:21 +0000 (18:00 +0200)
Enforcing no space(s) after a left parenthesis and before a right
parenthesis is a proposed change [0] which can only be merged when all
violations are fixed in projects enforcing checkstyle. This patch fixes
those violations.

[0] https://git.opendaylight.org/gerrit/#/c/51316/

Change-Id: Id3e4853bf1cee789d584d4fb528f5415084e26ab
Signed-off-by: Lorand Jakab <lojakab@cisco.com>
21 files changed:
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/RaftActor.java
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/RaftActorSnapshotMessageSupport.java
opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/RaftActorTest.java
opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/behaviors/FollowerTest.java
opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/behaviors/IsolatedLeaderTest.java
opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/behaviors/LeaderTest.java
opendaylight/md-sal/sal-cluster-admin-impl/src/test/java/org/opendaylight/controller/cluster/datastore/admin/ClusterAdminRpcServiceTest.java
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/common/actor/MeteredBoundedMailbox.java
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/AbstractNormalizedNodeDataOutput.java
opendaylight/md-sal/sal-clustering-commons/src/test/java/org/opendaylight/controller/cluster/datastore/node/utils/QNameFactoryTest.java
opendaylight/md-sal/sal-clustering-commons/src/test/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/NormalizedNodeStreamReaderWriterTest.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/DataChangeListener.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/shardmanager/ShardManager.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/utils/ActorContext.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/AbstractShardTest.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DataChangeListenerProxyTest.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DatastoreContextIntrospectorTest.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DatastoreSnapshotRestoreTest.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DistributedDataStoreRemotingIntegrationTest.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/utils/ActorContextTest.java
opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/registry/gossip/Gossiper.java

index b007e2d..08907e3 100644 (file)
@@ -368,7 +368,7 @@ public abstract class RaftActor extends AbstractUntypedPersistentActor {
     private void switchBehavior(SwitchBehavior message) {
         if (!getRaftActorContext().getRaftPolicy().automaticElectionsEnabled()) {
             RaftState newState = message.getNewState();
-            if ( newState == RaftState.Leader || newState == RaftState.Follower) {
+            if (newState == RaftState.Leader || newState == RaftState.Follower) {
                 switchBehavior(behaviorStateTracker.capture(getCurrentBehavior()),
                     AbstractRaftActorBehavior.createBehavior(context, message.getNewState()));
                 getRaftActorContext().getTermInformation().updateAndPersist(message.getNewTerm(), "");
index f119a1e..4c723bf 100644 (file)
@@ -59,7 +59,7 @@ class RaftActorSnapshotMessageSupport {
     }
 
     boolean handleSnapshotMessage(Object message, ActorRef sender) {
-        if (message instanceof ApplySnapshot ) {
+        if (message instanceof ApplySnapshot) {
             onApplySnapshot((ApplySnapshot) message);
         } else if (message instanceof SaveSnapshotSuccess) {
             onSaveSnapshotSuccess((SaveSnapshotSuccess) message);
index d674afb..3def4f0 100644 (file)
@@ -291,7 +291,7 @@ public class RaftActorTest extends AbstractActorTest {
         mockRaftActor.waitForRecoveryComplete();
 
         RaftActorRecoverySupport mockSupport = mock(RaftActorRecoverySupport.class);
-        mockRaftActor.setRaftActorRecoverySupport(mockSupport );
+        mockRaftActor.setRaftActorRecoverySupport(mockSupport);
 
         Snapshot snapshot = Snapshot.create(ByteState.of(new byte[]{1}),
                 Collections.<ReplicatedLogEntry>emptyList(), 3, 1, 3, 1, -1, null, null);
index 487a4fa..a6df34a 100644 (file)
@@ -112,7 +112,7 @@ public class FollowerTest extends AbstractRaftActorBehaviorTest<Follower> {
     @Override
     protected  MockRaftActorContext createActorContext(ActorRef actorRef) {
         MockRaftActorContext context = new MockRaftActorContext("follower", getSystem(), actorRef);
-        context.setPayloadVersion(payloadVersion );
+        context.setPayloadVersion(payloadVersion);
         return context;
     }
 
index 618bd4b..417e166 100644 (file)
@@ -89,7 +89,7 @@ public class IsolatedLeaderTest extends AbstractLeaderTest<IsolatedLeader> {
 
         newBehavior = isolatedLeader.handleMessage(senderActor,
                 new AppendEntriesReply("follower-2", isolatedLeader.lastTerm() - 1, true,
-                        isolatedLeader.lastIndex() - 1, isolatedLeader.lastTerm() - 1, (short)));
+                        isolatedLeader.lastIndex() - 1, isolatedLeader.lastTerm() - 1, (short) 0));
 
         assertEquals("Raft state", RaftState.Leader, newBehavior.state());
     }
@@ -116,13 +116,13 @@ public class IsolatedLeaderTest extends AbstractLeaderTest<IsolatedLeader> {
         // in a 5 member cluster, atleast 2 followers need to be active and return a reply
         RaftActorBehavior newBehavior = isolatedLeader.handleMessage(senderActor,
                 new AppendEntriesReply("follower-1", isolatedLeader.lastTerm() - 1, true,
-                        isolatedLeader.lastIndex() - 1, isolatedLeader.lastTerm() - 1, (short)));
+                        isolatedLeader.lastIndex() - 1, isolatedLeader.lastTerm() - 1, (short) 0));
 
         assertEquals("Raft state", RaftState.IsolatedLeader, newBehavior.state());
 
         newBehavior = isolatedLeader.handleMessage(senderActor,
                 new AppendEntriesReply("follower-2", isolatedLeader.lastTerm() - 1, true,
-                        isolatedLeader.lastIndex() - 1, isolatedLeader.lastTerm() - 1, (short)));
+                        isolatedLeader.lastIndex() - 1, isolatedLeader.lastTerm() - 1, (short) 0));
 
         assertEquals("Raft state", RaftState.Leader, newBehavior.state());
 
@@ -131,7 +131,7 @@ public class IsolatedLeaderTest extends AbstractLeaderTest<IsolatedLeader> {
 
         newBehavior = isolatedLeader.handleMessage(senderActor,
                 new AppendEntriesReply("follower-3", isolatedLeader.lastTerm() - 1, true,
-                        isolatedLeader.lastIndex() - 1, isolatedLeader.lastTerm() - 1, (short)));
+                        isolatedLeader.lastIndex() - 1, isolatedLeader.lastTerm() - 1, (short) 0));
 
         assertEquals("Raft state", RaftState.Leader, newBehavior.state());
     }
index f8297b0..c83a1a1 100644 (file)
@@ -536,7 +536,7 @@ public class LeaderTest extends AbstractLeaderTest<Leader> {
                 leaderActor, ApplyState.class);
         assertEquals("ApplyState count", newLogIndex, applyStateList.size());
 
-        for (int i = 0; i <= newLogIndex - 1; i++ ) {
+        for (int i = 0; i <= newLogIndex - 1; i++) {
             ApplyState applyState = applyStateList.get(i);
             assertEquals("getIndex", i + 1, applyState.getReplicatedLogEntry().getIndex());
             assertEquals("getTerm", term, applyState.getReplicatedLogEntry().getTerm());
index 674ceff..3ee37f6 100644 (file)
@@ -170,7 +170,7 @@ public class ClusterAdminRpcServiceTest {
     public void testAddShardReplica() throws Exception {
         String name = "testAddShardReplica";
         String moduleShardsConfig = "module-shards-cars-member-1.conf";
-        MemberNode leaderNode1 = MemberNode.builder(memberNodes).akkaConfig("Member1").testName(name )
+        MemberNode leaderNode1 = MemberNode.builder(memberNodes).akkaConfig("Member1").testName(name)
                 .moduleShardsConfig(moduleShardsConfig).waitForShardLeader("cars").build();
 
         MemberNode newReplicaNode2 = MemberNode.builder(memberNodes).akkaConfig("Member2").testName(name)
@@ -421,7 +421,7 @@ public class ClusterAdminRpcServiceTest {
     public void testAddReplicasForAllShards() throws Exception {
         String name = "testAddReplicasForAllShards";
         String moduleShardsConfig = "module-shards-member1.conf";
-        MemberNode leaderNode1 = MemberNode.builder(memberNodes).akkaConfig("Member1").testName(name )
+        MemberNode leaderNode1 = MemberNode.builder(memberNodes).akkaConfig("Member1").testName(name)
                 .moduleShardsConfig(moduleShardsConfig).waitForShardLeader("cars", "people").build();
 
         ModuleShardConfiguration petsModuleConfig = new ModuleShardConfiguration(URI.create("pets-ns"), "pets-module",
index 60a5106..f69c316 100644 (file)
@@ -73,7 +73,7 @@ public class MeteredBoundedMailbox implements MailboxType,
         }
     }
 
-    private static Gauge<Integer> getQueueSizeGuage(final MeteredMessageQueue monitoredQueue ) {
+    private static Gauge<Integer> getQueueSizeGuage(final MeteredMessageQueue monitoredQueue) {
         return () -> monitoredQueue.size();
     }
 
index 76b83b7..735f40d 100644 (file)
@@ -418,7 +418,7 @@ abstract class AbstractNormalizedNodeDataOutput implements NormalizedNodeDataOut
                 break;
             default :
                 throw new IllegalStateException("Unknown node identifier type is found : "
-                        + pathArgument.getClass().toString() );
+                        + pathArgument.getClass().toString());
         }
     }
 
index 1d551fc..9515240 100644 (file)
@@ -23,7 +23,7 @@ public class QNameFactoryTest {
         QName expected = TestModel.AUG_NAME_QNAME;
         QName created = QNameFactory.create(expected.toString());
 
-        assertFalse( expected == created);
+        assertFalse(expected == created);
 
         assertEquals(expected, created);
 
@@ -31,6 +31,6 @@ public class QNameFactoryTest {
 
         assertEquals(expected, cached);
 
-        assertTrue( cached == created );
+        assertTrue(cached == created);
     }
 }
index 40795d6..083a049 100644 (file)
@@ -168,7 +168,7 @@ public class NormalizedNodeStreamReaderWriterTest {
     @Test
     public void testWithSerializable() {
         NormalizedNode<?, ?> input = TestModel.createTestContainer();
-        SampleNormalizedNodeSerializable serializable = new SampleNormalizedNodeSerializable(input );
+        SampleNormalizedNodeSerializable serializable = new SampleNormalizedNodeSerializable(input);
         SampleNormalizedNodeSerializable clone =
                 (SampleNormalizedNodeSerializable)SerializationUtils.clone(serializable);
 
index cee7344..872feea 100644 (file)
@@ -70,7 +70,7 @@ public class DataChangeListener extends AbstractUntypedActor {
         try {
             this.listener.onDataChanged(change);
         } catch (RuntimeException e) {
-            LOG.error( String.format( "Error notifying listener %s", this.listener ), e );
+            LOG.error(String.format("Error notifying listener %s", this.listener), e);
         }
 
         if (isValidSender(getSender())) {
index db998f5..f824896 100644 (file)
@@ -1464,7 +1464,7 @@ class ShardManager extends AbstractUntypedPersistentActorWithMetering {
 
                     OnDemandRaftState raftState = (OnDemandRaftState) response;
                     Map<String, Boolean> serverVotingStatusMap = new HashMap<>();
-                    for ( Entry<String, Boolean> e: raftState.getPeerVotingStates().entrySet()) {
+                    for (Entry<String, Boolean> e: raftState.getPeerVotingStates().entrySet()) {
                         serverVotingStatusMap.put(e.getKey(), !e.getValue());
                     }
 
index f1a1f14..d3eb6f3 100644 (file)
@@ -272,7 +272,7 @@ public class ActorContext {
      *
      * @param shardName the name of the local shard that needs to be found
      */
-    public Future<ActorRef> findLocalShardAsync( final String shardName) {
+    public Future<ActorRef> findLocalShardAsync(final String shardName) {
         Future<Object> future = executeOperationAsync(shardManager,
                 new FindLocalShard(shardName, true), shardInitializationTimeout);
 
index e73fa08..8da5bf7 100644 (file)
@@ -490,7 +490,7 @@ public abstract class AbstractShardTest extends AbstractActorTest {
         }
 
         @SuppressWarnings("unchecked")
-        private <T> FutureCallback<T> mockFutureCallback(final FutureCallback<T> actual ) {
+        private <T> FutureCallback<T> mockFutureCallback(final FutureCallback<T> actual) {
             FutureCallback<T> mock = mock(FutureCallback.class);
             doAnswer(invocation -> {
                 actual.onFailure(invocation.getArgumentAt(0, Throwable.class));
index 2991754..d5416a0 100644 (file)
@@ -53,7 +53,7 @@ public class DataChangeListenerProxyTest extends AbstractActorTest {
         @Override
         public Set<YangInstanceIdentifier> getRemovedPaths() {
             Set<YangInstanceIdentifier> ids = new HashSet<>();
-            ids.add( CompositeModel.TEST_PATH);
+            ids.add(CompositeModel.TEST_PATH);
             return ids;
         }
 
index b470018..e397d1b 100644 (file)
@@ -32,7 +32,7 @@ public class DatastoreContextIntrospectorTest {
     public void testUpdate() {
         DatastoreContext context = DatastoreContext.newBuilder()
                 .logicalStoreType(LogicalDatastoreType.OPERATIONAL).build();
-        DatastoreContextIntrospector introspector = new DatastoreContextIntrospector(context );
+        DatastoreContextIntrospector introspector = new DatastoreContextIntrospector(context);
 
         Dictionary<String, Object> properties = new Hashtable<>();
         properties.put("shard-transaction-idle-timeout-in-minutes", "31");
@@ -122,7 +122,7 @@ public class DatastoreContextIntrospectorTest {
     public void testUpdateWithInvalidValues() {
         DatastoreContext context = DatastoreContext.newBuilder()
                 .logicalStoreType(LogicalDatastoreType.OPERATIONAL).build();
-        DatastoreContextIntrospector introspector = new DatastoreContextIntrospector(context );
+        DatastoreContextIntrospector introspector = new DatastoreContextIntrospector(context);
 
         Dictionary<String, Object> properties = new Hashtable<>();
         properties.put("shard-transaction-idle-timeout-in-minutes", "0"); // bad - must be > 0
index 3feb906..1c262ff 100644 (file)
@@ -49,13 +49,13 @@ public class DatastoreSnapshotRestoreTest {
         List<ShardSnapshot> shardSnapshots = new ArrayList<>();
         shardSnapshots.add(new ShardSnapshot("cars", new byte[]{1,2}));
         shardSnapshots.add(new ShardSnapshot("people", new byte[]{3,4}));
-        final DatastoreSnapshot configSnapshot = new DatastoreSnapshot("config", null, shardSnapshots );
+        final DatastoreSnapshot configSnapshot = new DatastoreSnapshot("config", null, shardSnapshots);
 
         shardSnapshots = new ArrayList<>();
         shardSnapshots.add(new ShardSnapshot("cars", new byte[]{5,6}));
         shardSnapshots.add(new ShardSnapshot("people", new byte[]{7,8}));
         shardSnapshots.add(new ShardSnapshot("bikes", new byte[]{9,0}));
-        DatastoreSnapshot operSnapshot = new DatastoreSnapshot("oper", null, shardSnapshots );
+        DatastoreSnapshot operSnapshot = new DatastoreSnapshot("oper", null, shardSnapshots);
 
         DatastoreSnapshotList snapshotList = new DatastoreSnapshotList();
         snapshotList.add(configSnapshot);
index 501da5c..3b14705 100644 (file)
@@ -218,7 +218,7 @@ public class DistributedDataStoreRemotingIntegrationTest extends AbstractTest {
         initDatastoresWithCars(testName);
 
         String followerCarShardName = "member-2-shard-cars-" + testName;
-        InMemoryJournal.addWriteMessagesCompleteLatch(followerCarShardName, 2, ApplyJournalEntries.class );
+        InMemoryJournal.addWriteMessagesCompleteLatch(followerCarShardName, 2, ApplyJournalEntries.class);
 
         DOMStoreWriteTransaction writeTx = followerDistributedDataStore.newWriteOnlyTransaction();
         assertNotNull("newWriteOnlyTransaction returned null", writeTx);
@@ -521,7 +521,7 @@ public class DistributedDataStoreRemotingIntegrationTest extends AbstractTest {
         initDatastoresWithCars(testName);
 
         String followerCarShardName = "member-2-shard-cars-" + testName;
-        InMemoryJournal.addWriteMessagesCompleteLatch(followerCarShardName, 1, ApplyJournalEntries.class );
+        InMemoryJournal.addWriteMessagesCompleteLatch(followerCarShardName, 1, ApplyJournalEntries.class);
 
         // Write top-level car container from the follower so it uses a remote Tx.
 
index cb0864f..3c60fb7 100644 (file)
@@ -110,11 +110,11 @@ public class ActorContextTest extends AbstractActorTest {
         }
 
         private static Props props(final boolean found, final ActorRef actorRef) {
-            return Props.create(new MockShardManagerCreator(found, actorRef) );
+            return Props.create(new MockShardManagerCreator(found, actorRef));
         }
 
         private static Props props() {
-            return Props.create(new MockShardManagerCreator() );
+            return Props.create(new MockShardManagerCreator());
         }
 
         @SuppressWarnings("serial")
index 015c0a1..f24ca33 100644 (file)
@@ -107,7 +107,7 @@ public class Gossiper extends AbstractUntypedActorWithMetering {
 
         bucketStore = new BucketStoreAccess(getContext(), config.getAskDuration());
 
-        if (provider instanceof ClusterActorRefProvider ) {
+        if (provider instanceof ClusterActorRefProvider) {
             cluster = Cluster.get(getContext().system());
             cluster.subscribe(getSelf(),
                     ClusterEvent.initialStateAsEvents(),

©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.