Use inline initialization of Stopwatch 69/36869/3
authorRobert Varga <rovarga@cisco.com>
Wed, 30 Mar 2016 08:55:53 +0000 (10:55 +0200)
committerRobert Varga <rovarga@cisco.com>
Wed, 30 Mar 2016 09:27:05 +0000 (11:27 +0200)
No need to have it the constructor, just inline the initialization.

Change-Id: Ife07c58baee22a503b1b4b4bbcd4c8fa8bb317dd
Signed-off-by: Robert Varga <rovarga@cisco.com>
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/behaviors/Leader.java

index a4ce0da..6d55316 100644 (file)
@@ -52,12 +52,11 @@ public class Leader extends AbstractLeader {
     @VisibleForTesting
     static final Object ISOLATED_LEADER_CHECK = new Object();
 
-    private final Stopwatch isolatedLeaderCheck;
+    private final Stopwatch isolatedLeaderCheck = Stopwatch.createStarted();
     private @Nullable LeadershipTransferContext leadershipTransferContext;
 
     public Leader(RaftActorContext context) {
         super(context, RaftState.Leader);
-        isolatedLeaderCheck = Stopwatch.createStarted();
     }
 
     @Override