Add assertNotNull to prevent null analysis warnings 81/18581/2
authorRobert Varga <rovarga@cisco.com>
Sat, 18 Apr 2015 15:40:19 +0000 (17:40 +0200)
committerRobert Varga <rovarga@cisco.com>
Sat, 18 Apr 2015 19:43:15 +0000 (21:43 +0200)
Eclipse can perform null-derefence analysis, which triggers a warning
here.

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

index 82ebcd1fbd5e4293aa114f6102b0eaf7a0f839fa..d60a9de0fd3b1c153c2533d575d1c3bcc0ec2e74 100644 (file)
@@ -472,6 +472,7 @@ public class RaftActorTest extends AbstractActorTest {
                 Uninterruptibles.sleepUninterruptibly(heartBeatInterval, TimeUnit.MILLISECONDS);
             }
 
+            assertNotNull(matches);
             assertEquals(2, matches.size());
 
             // check if the notifier got a role change from null to Follower
index 26e43648787530c8911bf2139a035df11224f768..c9cec158376faa6484f6c498bdaf41252875e411 100644 (file)
@@ -606,6 +606,7 @@ public class FollowerTest extends AbstractRaftActorBehaviorTest {
         ApplySnapshot applySnapshot = MessageCollectorActor.expectFirstMatching(followerActor,
                 ApplySnapshot.class);
         Snapshot snapshot = applySnapshot.getSnapshot();
+        assertNotNull(lastInstallSnapshot);
         assertEquals("getLastIndex", lastInstallSnapshot.getLastIncludedIndex(), snapshot.getLastIndex());
         assertEquals("getLastIncludedTerm", lastInstallSnapshot.getLastIncludedTerm(),
                 snapshot.getLastAppliedTerm());