Mechanical code cleanup (sal-akka-raft) 84/46084/3
authorStephen Kitt <skitt@redhat.com>
Thu, 22 Sep 2016 16:21:18 +0000 (18:21 +0200)
committerTom Pantelis <tpanteli@brocade.com>
Mon, 3 Oct 2016 16:17:43 +0000 (16:17 +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: I02567e9b21a73406863797a5a4eaa257e6eb20f2
Signed-off-by: Stephen Kitt <skitt@redhat.com>
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/RaftState.java
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/SnapshotManager.java
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/behaviors/AbstractLeader.java
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/behaviors/Follower.java
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/messages/InstallSnapshot.java
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/messages/RaftRPC.java
opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/MockRaftActorContext.java

index 139f1e1..57eb264 100644 (file)
@@ -785,7 +785,7 @@ public abstract class RaftActor extends AbstractUntypedPersistentActor {
 
     protected void onLeaderChanged(String oldLeader, String newLeader) {
 
-    };
+    }
 
     private String getLeaderAddress(){
         if(isLeader()){
index a362c6f..3fc43c7 100644 (file)
@@ -455,7 +455,7 @@ public class SnapshotManager implements SnapshotState {
 
     }
 
-    private static interface TermInformationReader {
+    private interface TermInformationReader {
         long getIndex();
         long getTerm();
     }
index 180f492..479ca5a 100644 (file)
@@ -83,7 +83,7 @@ public abstract class AbstractLeader extends AbstractRaftActorBehavior {
     private final Queue<ClientRequestTracker> trackers = new LinkedList<>();
 
     private Cancellable heartbeatSchedule = null;
-    private Optional<SnapshotHolder> snapshot = Optional.absent();;
+    private Optional<SnapshotHolder> snapshot = Optional.absent();
     private int minReplicationCount;
 
     protected AbstractLeader(RaftActorContext context, RaftState state,
index 5c9c0b7..cb141f9 100644 (file)
@@ -516,7 +516,7 @@ public class Follower extends AbstractRaftActorBehavior {
             if(snapshotTracker.addChunk(installSnapshot.getChunkIndex(), installSnapshot.getData(),
                     installSnapshot.getLastChunkHashCode())){
                 Snapshot snapshot = Snapshot.create(snapshotTracker.getSnapshot(),
-                        new ArrayList<ReplicatedLogEntry>(),
+                        new ArrayList<>(),
                         installSnapshot.getLastIncludedIndex(),
                         installSnapshot.getLastIncludedTerm(),
                         installSnapshot.getLastIncludedIndex(),
index bb50a74..32d3ae6 100644 (file)
@@ -60,13 +60,13 @@ public class MockRaftActorContext extends RaftActorContextImpl {
     }
 
     public MockRaftActorContext(){
-        super(null, null, "test", newElectionTerm(), -1, -1, new HashMap<String, String>(),
+        super(null, null, "test", newElectionTerm(), -1, -1, new HashMap<>(),
                 new DefaultConfigParamsImpl(), new NonPersistentDataProvider(), LOG);
         setReplicatedLog(new MockReplicatedLogBuilder().build());
     }
 
     public MockRaftActorContext(String id, ActorSystem system, ActorRef actor){
-        super(actor, null, id, newElectionTerm(), -1, -1, new HashMap<String, String>(),
+        super(actor, null, id, newElectionTerm(), -1, -1, new HashMap<>(),
                 new DefaultConfigParamsImpl(), new NonPersistentDataProvider(), LOG);
 
         this.system = system;