Program: 87217
Project: 87217
Buggy source:
public void processMessage(Transport.Packet aPacket){
  if (guard())   return;
  try {
    if (_common.testState(Constants.FSMStates.OUT_OF_DATE)) {
      return;
    }
    PaxosMessage myMessage=aPacket.getMessage();
    long mySeqNum=myMessage.getSeqNum();
    if (_common.testState(Constants.FSMStates.RECOVERING)) {
switch (myMessage.getType()) {
case Operations.NEED:
{
          _logger.debug("String_Node_Str" + aPacket);
          process(aPacket,new ReplayWriter(0),new LiveSender());
          return;
        }
case Operations.OUTOFDATE:
{
synchronized (this) {
          completedRecovery();
          _common.setState(Constants.FSMStates.OUT_OF_DATE);
        }
        signal(new StateEvent(StateEvent.Reason.OUT_OF_DATE,mySeqNum,_common.getLeaderRndNum(),new Proposal(),aPacket.getSource()));
        return;
      }
  }
}
final Writer myWriter=new LiveWriter();
int myProcessed;
_sorter.add(aPacket);
do {
  myProcessed=_sorter.process(_common.getLowWatermark().getSeqNum(),new PacketSorter.PacketProcessor(){
    public void consume(    Transport.Packet aPacket){
      boolean myRecoveryInProgress=_common.testState(Constants.FSMStates.RECOVERING);
      Sender mySender=(myRecoveryInProgress) ? new RecoverySender() : new LiveSender();
      process(aPacket,myWriter,mySender);
      if (myRecoveryInProgress) {
        if ((_common.getLowWatermark().getSeqNum() == _recoveryWindow.get().getMaxSeq()) && (_common.testAndSetState(Constants.FSMStates.RECOVERING,Constants.FSMStates.ACTIVE))) {
          _common.resetLeaderAction();
          completedRecovery();
        }
      }
    }
    public boolean recover(    Need aNeed){
      boolean myResult=_common.testAndSetState(Constants.FSMStates.ACTIVE,Constants.FSMStates.RECOVERING);
      if (myResult) {
        _recoveryWindow.set(aNeed);
        _cachedBegins.clear();
        _acceptLedgers.clear();
        _logger.debug(AcceptorLearner.this.toString() + "String_Node_Str" + Long.toHexString(_common.getLowWatermark().getSeqNum()));
        if (_common.getLastCollect().getMessage().getSeqNum() > aNeed.getMinSeq()) {
          _logger.warn(AcceptorLearner.this.toString() + "String_Node_Str" + _common.getLastCollect().getMessage()+ "String_Node_Str"+ aNeed);
          _common.clearLeadership();
        }
        new LiveSender().send(aNeed,_common.getTransport().getFD().getRandomMember(_common.getTransport().getLocalAddress()));
        reschedule();
      }
      return myResult;
    }
  }
);
}
 while (myProcessed != 0);
}
  finally {
unguard();
}
}

Fixed version (ground truth):
public void processMessage(Transport.Packet aPacket){
  if (guard())   return;
  try {
    if (_common.testState(Constants.FSMStates.OUT_OF_DATE)) {
      return;
    }
    PaxosMessage myMessage=aPacket.getMessage();
    long mySeqNum=myMessage.getSeqNum();
    if (_common.testState(Constants.FSMStates.RECOVERING)) {
switch (myMessage.getType()) {
case Operations.NEED:
{
          _logger.debug("String_Node_Str" + aPacket);
          process(aPacket,new ReplayWriter(0),new LiveSender());
          return;
        }
case Operations.OUTOFDATE:
{
synchronized (this) {
          completedRecovery();
          _common.setState(Constants.FSMStates.OUT_OF_DATE);
        }
        signal(new StateEvent(StateEvent.Reason.OUT_OF_DATE,mySeqNum,_common.getLeaderRndNum(),new Proposal(),aPacket.getSource()));
        return;
      }
  }
}
final Writer myWriter=new LiveWriter();
int myProcessed;
_sorter.add(aPacket);
do {
  myProcessed=_sorter.process(_common.getLowWatermark().getSeqNum(),new PacketSorter.PacketProcessor(){
    public void consume(    Transport.Packet aPacket){
      boolean myRecoveryInProgress=_common.testState(Constants.FSMStates.RECOVERING);
      Sender mySender=(myRecoveryInProgress) ? new RecoverySender() : new LiveSender();
      process(aPacket,myWriter,mySender);
      if (myRecoveryInProgress) {
        if ((_common.getLowWatermark().getSeqNum() == _recoveryWindow.get().getMaxSeq()) && (_common.testAndSetState(Constants.FSMStates.RECOVERING,Constants.FSMStates.ACTIVE))) {
          _common.resetLeaderAction();
          completedRecovery();
        }
      }
    }
    public boolean recover(    Need aNeed){
      boolean myResult=_common.testAndSetState(Constants.FSMStates.ACTIVE,Constants.FSMStates.RECOVERING);
      if (myResult) {
        _recoveryWindow.set(aNeed);
        _cachedBegins.clear();
        _acceptLedgers.clear();
        _logger.debug(AcceptorLearner.this.toString() + "String_Node_Str" + Long.toHexString(_common.getLowWatermark().getSeqNum()));
        if (_common.getLastCollect().getMessage().getSeqNum() > aNeed.getMinSeq()) {
          _logger.warn(AcceptorLearner.this.toString() + "String_Node_Str" + _common.getLastCollect().getMessage()+ "String_Node_Str"+ aNeed);
          _common.clearLeadership();
        }
        InetSocketAddress myNeedTarget=_common.getTransport().getFD().getRandomMember(_common.getTransport().getLocalAddress());
        if (myNeedTarget != null)         new LiveSender().send(aNeed,myNeedTarget);
        reschedule();
      }
      return myResult;
    }
  }
);
}
 while (myProcessed != 0);
}
  finally {
unguard();
}
}