Mechanical code cleanup (sal-remoterpc-connector) 67/46067/3
authorStephen Kitt <skitt@redhat.com>
Thu, 22 Sep 2016 15:22:45 +0000 (17:22 +0200)
committerTom Pantelis <tpanteli@brocade.com>
Fri, 23 Sep 2016 18:51:26 +0000 (18:51 +0000)
* Remove unnecessary type specifiers (use Java 7 <>)
* Remove unnecessary "extends Object" declarations
* Remove unnecessary semi-colons
* Merge identical catch blocks
* Remove redundant modifiers:
  - enum constructors are private by default
  - interface properties are public static final by default
  - interface methods are public abstract by default
  - interfaces are abstract by default
  - inner interfaces are static by default
  - inner classes in interfaces are public static by default

Change-Id: I502b5887cadb1a7cdbc42e7b817495f9c767a4a1
Signed-off-by: Stephen Kitt <skitt@redhat.com>
opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/registry/gossip/Bucket.java
opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/registry/gossip/BucketStore.java
opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/registry/gossip/Copier.java
opendaylight/md-sal/sal-remoterpc-connector/src/test/java/org/opendaylight/controller/remote/rpc/RemoteRpcImplementationTest.java
opendaylight/md-sal/sal-remoterpc-connector/src/test/java/org/opendaylight/controller/remote/rpc/registry/gossip/BucketStoreTest.java
opendaylight/md-sal/sal-remoterpc-connector/src/test/java/org/opendaylight/controller/remote/rpc/utils/LatestEntryRoutingLogicTest.java

index cc24e68..3ec56b7 100644 (file)
@@ -120,7 +120,7 @@ public class BucketStore<T extends Copier<T>> extends AbstractUntypedActorWithMe
      */
     void receiveGetAllBuckets(){
         final ActorRef sender = getSender();
-        sender.tell(new GetAllBucketsReply<T>(getAllBuckets()), getSelf());
+        sender.tell(new GetAllBucketsReply<>(getAllBuckets()), getSelf());
     }
 
     /**
@@ -148,7 +148,7 @@ public class BucketStore<T extends Copier<T>> extends AbstractUntypedActorWithMe
     void receiveGetBucketsByMembers(Set<Address> members){
         final ActorRef sender = getSender();
         Map<Address, Bucket<T>> buckets = getBucketsByMembers(members);
-        sender.tell(new GetBucketsByMembersReply<T>(buckets), getSelf());
+        sender.tell(new GetBucketsByMembersReply<>(buckets), getSelf());
     }
 
     /**
index b3ed7ff..a70b90b 100644 (file)
@@ -81,7 +81,7 @@ public class RemoteRpcImplementationTest extends AbstractRpcTest {
         assertEquals("getType", TEST_RPC, routeIdentifier.getType());
         assertEquals("getRoute", TEST_PATH, routeIdentifier.getRoute());
 
-        rpcRegistry1Probe.reply(new RpcRegistry.Messages.FindRoutersReply(Arrays.asList(new Pair<ActorRef, Long>(
+        rpcRegistry1Probe.reply(new RpcRegistry.Messages.FindRoutersReply(Arrays.asList(new Pair<>(
                 rpcBroker2, 200L))));
 
         final DOMRpcResult result = frontEndFuture.checkedGet(5, TimeUnit.SECONDS);
@@ -111,7 +111,7 @@ public class RemoteRpcImplementationTest extends AbstractRpcTest {
         assertEquals("getType", TEST_RPC, routeIdentifier.getType());
         assertEquals("getRoute", TEST_PATH, routeIdentifier.getRoute());
 
-        rpcRegistry1Probe.reply(new RpcRegistry.Messages.FindRoutersReply(Arrays.asList(new Pair<ActorRef, Long>(
+        rpcRegistry1Probe.reply(new RpcRegistry.Messages.FindRoutersReply(Arrays.asList(new Pair<>(
                 rpcBroker2, 200L))));
 
         final DOMRpcResult result = frontEndFuture.checkedGet(5, TimeUnit.SECONDS);
@@ -143,7 +143,7 @@ public class RemoteRpcImplementationTest extends AbstractRpcTest {
         assertEquals("getType", TEST_RPC, routeIdentifier.getType());
         assertEquals("getRoute", TEST_PATH, routeIdentifier.getRoute());
 
-        rpcRegistry1Probe.reply(new RpcRegistry.Messages.FindRoutersReply(Arrays.asList(new Pair<ActorRef, Long>(
+        rpcRegistry1Probe.reply(new RpcRegistry.Messages.FindRoutersReply(Arrays.asList(new Pair<>(
                 rpcBroker2, 200L))));
 
         final DOMRpcResult result = frontEndFuture.checkedGet(5, TimeUnit.SECONDS);
@@ -176,7 +176,7 @@ public class RemoteRpcImplementationTest extends AbstractRpcTest {
         assertEquals("getType", TEST_RPC, routeIdentifier.getType());
         assertEquals("getRoute", TEST_PATH, routeIdentifier.getRoute());
 
-        rpcRegistry1Probe.reply(new RpcRegistry.Messages.FindRoutersReply(Arrays.asList(new Pair<ActorRef, Long>(
+        rpcRegistry1Probe.reply(new RpcRegistry.Messages.FindRoutersReply(Arrays.asList(new Pair<>(
                 rpcBroker2, 200L))));
         frontEndFuture.checkedGet(5, TimeUnit.SECONDS);
     }
index c2c158b..2c9a141 100644 (file)
@@ -87,7 +87,7 @@ public class BucketStoreTest {
 
         //Add a new remote bucket
         Address a4 = new Address("tcp", "system4");
-        Bucket<T> b4 = new BucketImpl<T>();
+        Bucket<T> b4 = new BucketImpl<>();
         remoteBuckets.clear();
         remoteBuckets.put(a4, b4);
         store.receiveUpdateRemoteBuckets(remoteBuckets);
@@ -99,7 +99,7 @@ public class BucketStoreTest {
         Assert.assertTrue(remoteBucketsInStore.size() == 4);
 
         //Update a bucket
-        Bucket<T> b3_new = new BucketImpl<T>();
+        Bucket<T> b3_new = new BucketImpl<>();
         remoteBuckets.clear();
         remoteBuckets.put(a3, b3_new);
         remoteBuckets.put(a1, null);
index f74bfc3..a618bff 100644 (file)
@@ -46,9 +46,9 @@ public class LatestEntryRoutingLogicTest {
     ActorRef actor1 = probe1.ref();
     ActorRef actor2 = probe2.ref();
     ActorRef actor3 = probe3.ref();
-    pairList.add(new Pair<ActorRef, Long>(actor1, 1000L));
-    pairList.add(new Pair<ActorRef, Long>(actor2, 3000L));
-    pairList.add(new Pair<ActorRef, Long>(actor3, 2000L));
+    pairList.add(new Pair<>(actor1, 1000L));
+    pairList.add(new Pair<>(actor2, 3000L));
+    pairList.add(new Pair<>(actor3, 2000L));
     RoutingLogic logic = new LatestEntryRoutingLogic(pairList);
     assertTrue(logic.select().equals(actor2));
   }

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