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 a4ce0da482dbfc16e3d34c97b536f6c1ce02efc8..6d55316586cf85c725bb8e39953ee64b4f08217c 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