Program: 113493
Project: 113493
Buggy source:
/** 
 * Handles paxos prepare messages
 * @param msg the incomming message
 * @return a response message
 */
public FleaseMessage handlePREPARE(FleaseMessage msg){
  final FleaseAcceptorCell cc=getCell(msg);
  cc.touch();
  if ((cc.getPrepared() != null) && (cc.getPrepared().after(msg))) {
    if (Logging.isDebug()) {
      final String preped=(cc.getPrepared() == null) ? ProposalNumber.EMPTY_PROPOSAL_NUMBER.toString() : cc.getPrepared().getProposalNo().toString();
      Logging.logMessage(Logging.LEVEL_DEBUG,Category.replication,this,"String_Node_Str" + preped + "String_Node_Str"+ msg.getProposalNo()+ "String_Node_Str");
    }
    FleaseMessage reject=new FleaseMessage(FleaseMessage.MsgType.MSG_PREPARE_NACK,msg);
    reject.setPrevProposalNo(cc.getPrepared().getProposalNo());
    reject.setLeaseHolder(null);
    reject.setLeaseTimeout(0);
    reject.setSendTimestamp(TimeSync.getGlobalTime());
    return reject;
  }
 else {
    if (Logging.isDebug()) {
      final String preped=(cc.getPrepared() == null) ? ProposalNumber.EMPTY_PROPOSAL_NUMBER.toString() : cc.getPrepared().getProposalNo().toString();
      final String acced=(cc.getAccepted() == null) ? ProposalNumber.EMPTY_PROPOSAL_NUMBER.toString() : cc.getAccepted().getProposalNo() + "String_Node_Str" + cc.getAccepted().getLeaseHolder()+ "String_Node_Str"+ cc.getAccepted().getLeaseTimeout();
      Logging.logMessage(Logging.LEVEL_DEBUG,Category.replication,this,"String_Node_Str" + preped + "String_Node_Str"+ msg.getProposalNo()+ "String_Node_Str"+ acced);
    }
    cc.setPrepared(msg);
    FleaseMessage response=new FleaseMessage(FleaseMessage.MsgType.MSG_PREPARE_ACK,msg);
    if (cc.getAccepted() != null) {
      response.setPrevProposalNo(cc.getAccepted().getProposalNo());
      response.setLeaseHolder(cc.getAccepted().getLeaseHolder());
      assert(response.getLeaseHolder() != null);
      response.setLeaseTimeout(cc.getAccepted().getLeaseTimeout());
    }
    response.setSendTimestamp(TimeSync.getGlobalTime());
    return response;
  }
}

Fixed version (ground truth):
/** 
 * Handles paxos prepare messages
 * @param msg the incomming message
 * @return a response message
 */
public FleaseMessage handlePREPARE(FleaseMessage msg){
  final FleaseAcceptorCell cc=getCell(msg);
  cc.touch();
  if ((cc.getPrepared() != null) && (cc.getPrepared().after(msg))) {
    if (Logging.isDebug() && config.isDebugPrintMessages()) {
      final String preped=(cc.getPrepared() == null) ? ProposalNumber.EMPTY_PROPOSAL_NUMBER.toString() : cc.getPrepared().getProposalNo().toString();
      Logging.logMessage(Logging.LEVEL_DEBUG,Category.replication,this,"String_Node_Str" + preped + "String_Node_Str"+ msg.getProposalNo()+ "String_Node_Str");
    }
    FleaseMessage reject=new FleaseMessage(FleaseMessage.MsgType.MSG_PREPARE_NACK,msg);
    reject.setPrevProposalNo(cc.getPrepared().getProposalNo());
    reject.setLeaseHolder(null);
    reject.setLeaseTimeout(0);
    reject.setSendTimestamp(TimeSync.getGlobalTime());
    return reject;
  }
 else {
    if (Logging.isDebug() && config.isDebugPrintMessages()) {
      final String preped=(cc.getPrepared() == null) ? ProposalNumber.EMPTY_PROPOSAL_NUMBER.toString() : cc.getPrepared().getProposalNo().toString();
      final String acced=(cc.getAccepted() == null) ? ProposalNumber.EMPTY_PROPOSAL_NUMBER.toString() : cc.getAccepted().getProposalNo() + "String_Node_Str" + cc.getAccepted().getLeaseHolder()+ "String_Node_Str"+ cc.getAccepted().getLeaseTimeout();
      Logging.logMessage(Logging.LEVEL_DEBUG,Category.replication,this,"String_Node_Str" + preped + "String_Node_Str"+ msg.getProposalNo()+ "String_Node_Str"+ acced);
    }
    cc.setPrepared(msg);
    FleaseMessage response=new FleaseMessage(FleaseMessage.MsgType.MSG_PREPARE_ACK,msg);
    if (cc.getAccepted() != null) {
      response.setPrevProposalNo(cc.getAccepted().getProposalNo());
      response.setLeaseHolder(cc.getAccepted().getLeaseHolder());
      assert(response.getLeaseHolder() != null);
      response.setLeaseTimeout(cc.getAccepted().getLeaseTimeout());
    }
    response.setSendTimestamp(TimeSync.getGlobalTime());
    return response;
  }
}