Do not allow RaftActorBehavior.close() to throw Exception 90/36890/3
authorRobert Varga <rovarga@cisco.com>
Wed, 30 Mar 2016 14:50:55 +0000 (16:50 +0200)
committerRobert Varga <rovarga@cisco.com>
Thu, 31 Mar 2016 08:22:23 +0000 (10:22 +0200)
No implementation uses the ability to throw here, disallow it in API contract.

Change-Id: I8560e60a7cab06f221ff7382f9c205d967efcfe5
Signed-off-by: Robert Varga <rovarga@cisco.com>
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/behaviors/Candidate.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/behaviors/RaftActorBehavior.java

index 612c327aeb054dd1cacb8a74a82861ede3f3ef0d..72e8e8c2a70b50ed5022b392918bbadc58697eba 100644 (file)
@@ -192,7 +192,8 @@ public class Candidate extends AbstractRaftActorBehavior {
         }
     }
 
-    @Override public void close() throws Exception {
+    @Override
+    public void close() {
         stopElection();
     }
 }
index 33ed3357d85eab27441c7eafdd6d494974d667eb..f483f0199e393e84b9d31bc598279f26f1d4a749 100644 (file)
@@ -427,7 +427,7 @@ public class Follower extends AbstractRaftActorBehavior {
     }
 
     @Override
-    public void close() throws Exception {
+    public void close() {
         stopElection();
     }
 
index b0a7638b92abdec6aef770cc6170a5c5353cc434..e7f43c898c1e4506ab1e382ae153c05d2eb6950e 100644 (file)
@@ -74,4 +74,7 @@ public interface RaftActorBehavior extends AutoCloseable{
      * @return The new behavior
      */
     RaftActorBehavior switchBehavior(RaftActorBehavior behavior);
+
+    @Override
+    void close();
 }