Fix more Sonar warnings
[controller.git] / opendaylight / md-sal / sal-akka-raft / src / main / java / org / opendaylight / controller / cluster / raft / behaviors / LeaderInstallSnapshotState.java
index e7c76bacbeaa539c2d91488a3c9b305f7dae04e1..68e82dc9a1151a05f47521188fb8304472c15c9b 100644 (file)
@@ -49,7 +49,7 @@ public final class LeaderInstallSnapshotState implements AutoCloseable {
     private int nextChunkHashCode = INITIAL_LAST_CHUNK_HASH_CODE;
     private long snapshotSize;
     private InputStream snapshotInputStream;
-    private Stopwatch chunkTimer = Stopwatch.createUnstarted();
+    private final Stopwatch chunkTimer = Stopwatch.createUnstarted();
     private byte[] currentChunk = null;
 
     LeaderInstallSnapshotState(final int snapshotChunkSize, final String logName) {
@@ -198,7 +198,7 @@ public final class LeaderInstallSnapshotState implements AutoCloseable {
             try {
                 snapshotInputStream.close();
             } catch (IOException e) {
-                LOG.warn("{}: Error closing snapshot stream", logName);
+                LOG.warn("{}: Error closing snapshot stream", logName, e);
             }
 
             snapshotInputStream = null;