Program: 87209
Project: 87209
Buggy source:
public void processMessage(Transport.Packet aPacket){
  if (guard())   return;
  try {
    if (_common.getNodeState().test(NodeState.State.OUT_OF_DATE)) {
      return;
    }
    PaxosMessage myMessage=aPacket.getMessage();
    long mySeqNum=myMessage.getSeqNum();
    if (_common.getNodeState().test(NodeState.State.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.getNodeState().set(NodeState.State.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.getNodeState().test(NodeState.State.RECOVERING);
      Sender mySender=((myRecoveryInProgress) || (!_common.amMember())) ? new RecoverySender() : new LiveSender();
      process(aPacket,myWriter,mySender);
      if (myRecoveryInProgress) {
        if ((_common.getLowWatermark().getSeqNum() == _recoveryWindow.get().getMaxSeq()) && (_common.getNodeState().testAndSet(NodeState.State.RECOVERING,NodeState.State.ACTIVE))) {
          _common.resetLeaderAction();
          completedRecovery();
        }
      }
    }
    public boolean recover(    Need aNeed){
      boolean myResult=_common.getNodeState().testAndSet(NodeState.State.ACTIVE,NodeState.State.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();
}
}

Fixed version (ground truth):
public void processMessage(Transport.Packet aPacket){
  if (guard())   return;
  try {
    if (_common.getNodeState().test(NodeState.State.OUT_OF_DATE)) {
      return;
    }
    PaxosMessage myMessage=aPacket.getMessage();
    long mySeqNum=myMessage.getSeqNum();
    if (_common.getNodeState().test(NodeState.State.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.getNodeState().set(NodeState.State.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.getNodeState().test(NodeState.State.RECOVERING);
      Sender mySender=((myRecoveryInProgress) || (!_common.amMember())) ? new RecoverySender() : new LiveSender();
      process(aPacket,myWriter,mySender);
      if (myRecoveryInProgress) {
        if ((_common.getLowWatermark().getSeqNum() == _recoveryWindow.get().getMaxSeq()) && (_common.getNodeState().testAndSet(NodeState.State.RECOVERING,NodeState.State.ACTIVE))) {
          _common.resetLeaderAction();
          completedRecovery();
        }
      }
    }
    public boolean recover(    Need aNeed,    InetSocketAddress aSourceAddr){
      boolean myResult=_common.getNodeState().testAndSet(NodeState.State.ACTIVE,NodeState.State.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);
 else         new LiveSender().send(aNeed,aSourceAddr);
        reschedule();
      }
      return myResult;
    }
  }
);
}
 while (myProcessed != 0);
}
  finally {
unguard();
}
}