Program: 130717
Project: 130717
Buggy source:
@Override public String electLeader() throws Exception {
  ClusterConfiguration clusterConfig=persistence.getLastSeenConfig();
  Zxid lastZxid=persistence.getLog().getLatestZxid();
  String serverId=clusterConfig.getServerId();
  long ackEpoch=persistence.getAckEpoch();
  HashMap<String,VoteInfo> receivedVotes=new HashMap<String,VoteInfo>();
  this.round++;
  this.voteInfo=new VoteInfo(serverId,ackEpoch,lastZxid,round,true);
  int timeoutMs=100;
  int maxTimeoutMs=1600;
  broadcast(clusterConfig);
  while (true) {
    VoteTuple tuple=getVote(timeoutMs);
    if (tuple == null) {
      if (receivedVotes.size() >= clusterConfig.getQuorumSize()) {
        this.voteInfo.electing=false;
        return this.voteInfo.vote;
      }
 else {
        broadcast(clusterConfig);
        timeoutMs=(timeoutMs * 2 > maxTimeoutMs) ? maxTimeoutMs : 2 * timeoutMs;
        continue;
      }
    }
    VoteInfo vote=tuple.voteInfo;
    String source=tuple.source;
    if (vote.electing) {
      if (vote.round > this.voteInfo.round) {
        LOG.debug("String_Node_Str",vote.round,this.voteInfo.round);
        this.round=vote.round;
        this.voteInfo.round=vote.round;
        receivedVotes.clear();
        if (this.voteInfo.compareTo(vote) < 0) {
          this.voteInfo=vote;
        }
        broadcast(clusterConfig);
      }
 else       if (vote.round == this.voteInfo.round && this.voteInfo.compareTo(vote) < 0) {
        this.voteInfo=vote;
        broadcast(clusterConfig);
      }
 else       if (vote.round < this.voteInfo.round) {
        continue;
      }
 else       if (vote.round == this.voteInfo.round && this.voteInfo.compareTo(vote) > 0) {
        broadcast(clusterConfig);
      }
      receivedVotes.put(source,vote);
      if (receivedVotes.size() == clusterConfig.getPeers().size()) {
        this.voteInfo.electing=false;
        return this.voteInfo.vote;
      }
    }
 else {
      this.voteInfo=vote;
      this.voteInfo.electing=false;
      return this.voteInfo.vote;
    }
  }
}

Fixed version (ground truth):
@Override public String electLeader() throws Exception {
  ClusterConfiguration clusterConfig=persistence.getLastSeenConfig();
  Zxid lastZxid=persistence.getLog().getLatestZxid();
  String serverId=clusterConfig.getServerId();
  long ackEpoch=persistence.getAckEpoch();
  HashMap<String,VoteInfo> receivedVotes=new HashMap<String,VoteInfo>();
  this.round++;
  this.voteInfo=new VoteInfo(serverId,ackEpoch,lastZxid,round,true);
  int timeoutMs=100;
  int maxTimeoutMs=1600;
  broadcast(clusterConfig);
  while (true) {
    VoteTuple tuple=getVote(timeoutMs);
    if (tuple == null) {
      if (receivedVotes.size() >= clusterConfig.getQuorumSize()) {
        this.voteInfo.electing=false;
        return this.voteInfo.vote;
      }
 else {
        broadcast(clusterConfig);
        timeoutMs=(timeoutMs * 2 > maxTimeoutMs) ? maxTimeoutMs : 2 * timeoutMs;
        continue;
      }
    }
    VoteInfo vote=tuple.voteInfo;
    String source=tuple.source;
    if (!clusterConfig.contains(source)) {
      LOG.debug("String_Node_Str" + "String_Node_Str",source);
      continue;
    }
    if (vote.electing) {
      if (vote.round > this.voteInfo.round) {
        LOG.debug("String_Node_Str",vote.round,this.voteInfo.round);
        this.round=vote.round;
        this.voteInfo.round=vote.round;
        receivedVotes.clear();
        if (this.voteInfo.compareTo(vote) < 0) {
          this.voteInfo=vote;
        }
        broadcast(clusterConfig);
      }
 else       if (vote.round == this.voteInfo.round && this.voteInfo.compareTo(vote) < 0) {
        this.voteInfo=vote;
        broadcast(clusterConfig);
      }
 else       if (vote.round < this.voteInfo.round) {
        continue;
      }
 else       if (vote.round == this.voteInfo.round && this.voteInfo.compareTo(vote) > 0) {
        broadcast(clusterConfig);
      }
      receivedVotes.put(source,vote);
      if (receivedVotes.size() == clusterConfig.getPeers().size()) {
        this.voteInfo.electing=false;
        return this.voteInfo.vote;
      }
    }
 else {
      this.voteInfo=vote;
      this.voteInfo.electing=false;
      return this.voteInfo.vote;
    }
  }
}