Merge "Add generic arguments"
authorMoiz Raja <moraja@cisco.com>
Fri, 10 Apr 2015 16:08:56 +0000 (16:08 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Fri, 10 Apr 2015 16:08:57 +0000 (16:08 +0000)
1  2 
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/example/ExampleActor.java

index 77eaac2cfef076fd84959d0e9007fe6233413c9d,bafa116b55eb03e23fcc87279bcc245792b24787..5ab3f69bea994d60644cca47b9694205ae2ab039
@@@ -37,9 -34,9 +37,9 @@@ import org.opendaylight.controller.clus
  /**
   * A sample actor showing how the RaftActor is to be extended
   */
 -public class ExampleActor extends RaftActor {
 +public class ExampleActor extends RaftActor implements RaftActorRecoveryCohort, RaftActorSnapshotCohort {
  
-     private final Map<String, String> state = new HashMap();
+     private final Map<String, String> state = new HashMap<>();
  
      private long persistIdentifier = 1;
      private final Optional<ActorRef> roleChangeNotifier;
          getSelf().tell(new CaptureSnapshotReply(bs.toByteArray()), null);
      }
  
 -    @Override protected void applySnapshot(byte [] snapshot) {
 +    @Override
 +    public void applySnapshot(byte [] snapshot) {
          state.clear();
          try {
-             state.putAll((HashMap) toObject(snapshot));
+             state.putAll((HashMap<String, String>) toObject(snapshot));
          } catch (Exception e) {
             LOG.error("Exception in applying snapshot", e);
          }