Program: 59701
Project: 59701
Buggy source:
public synchronized void onEvaluatorHeartbeatMessage(final RemoteMessage<EvaluatorRuntimeProtocol.EvaluatorHeartbeatProto> evaluatorHeartbeatProtoRemoteMessage){
  final EvaluatorRuntimeProtocol.EvaluatorHeartbeatProto evaluatorHeartbeatProto=evaluatorHeartbeatProtoRemoteMessage.getMessage();
  LOG.log(Level.FINEST,"String_Node_Str",evaluatorHeartbeatProto);
  if (this.stateManager.isDoneOrFailedOrKilled()) {
    LOG.log(Level.FINE,"String_Node_Str",new Object[]{this.getId(),this.stateManager});
    return;
  }
  this.sanityChecker.check(evaluatorId,evaluatorHeartbeatProto.getTimestamp());
  final String evaluatorRID=evaluatorHeartbeatProtoRemoteMessage.getIdentifier().toString();
  if (evaluatorHeartbeatProto.getRecovery()) {
    this.evaluatorControlHandler.setRemoteID(evaluatorRID);
    this.stateManager.setRunning();
    this.driverStatusManager.oneContainerRecovered();
    final int numRecoveredContainers=this.driverStatusManager.getNumRecoveredContainers();
    LOG.log(Level.FINE,"String_Node_Str",this.evaluatorId);
    final int expectedEvaluatorsNumber=this.driverStatusManager.getNumPreviousContainers();
    if (numRecoveredContainers > expectedEvaluatorsNumber) {
      LOG.log(Level.SEVERE,"String_Node_Str",new Object[]{expectedEvaluatorsNumber,numRecoveredContainers});
      throw new RuntimeException("String_Node_Str");
    }
 else     if (numRecoveredContainers == expectedEvaluatorsNumber) {
      LOG.log(Level.INFO,"String_Node_Str",expectedEvaluatorsNumber);
      this.driverStatusManager.setRestartCompleted();
      this.messageDispatcher.OnDriverRestartCompleted(new DriverRestartCompleted(System.currentTimeMillis()));
    }
 else {
      LOG.log(Level.INFO,"String_Node_Str",new Object[]{expectedEvaluatorsNumber,numRecoveredContainers});
    }
  }
  if (this.stateManager.isSubmitted()) {
    this.evaluatorControlHandler.setRemoteID(evaluatorRID);
    this.stateManager.setRunning();
    LOG.log(Level.FINEST,"String_Node_Str",this.evaluatorId);
  }
  if (evaluatorHeartbeatProto.hasEvaluatorStatus()) {
    this.onEvaluatorStatusMessage(evaluatorHeartbeatProto.getEvaluatorStatus());
  }
  final boolean informClientOfNewContexts=!evaluatorHeartbeatProto.hasTaskStatus();
  this.contextRepresenters.onContextStatusMessages(evaluatorHeartbeatProto.getContextStatusList(),informClientOfNewContexts);
  if (evaluatorHeartbeatProto.hasTaskStatus()) {
    this.onTaskStatusMessage(evaluatorHeartbeatProto.getTaskStatus());
  }
  LOG.log(Level.FINE,"String_Node_Str",this.getId());
}

Fixed version (ground truth):
public void onEvaluatorHeartbeatMessage(final RemoteMessage<EvaluatorRuntimeProtocol.EvaluatorHeartbeatProto> evaluatorHeartbeatProtoRemoteMessage){
  final EvaluatorRuntimeProtocol.EvaluatorHeartbeatProto evaluatorHeartbeatProto=evaluatorHeartbeatProtoRemoteMessage.getMessage();
  LOG.log(Level.FINEST,"String_Node_Str",evaluatorHeartbeatProto);
synchronized (this.evaluatorDescriptor) {
    if (this.stateManager.isDoneOrFailedOrKilled()) {
      LOG.log(Level.FINE,"String_Node_Str",new Object[]{this.getId(),this.stateManager});
      return;
    }
    this.sanityChecker.check(evaluatorId,evaluatorHeartbeatProto.getTimestamp());
    final String evaluatorRID=evaluatorHeartbeatProtoRemoteMessage.getIdentifier().toString();
    if (evaluatorHeartbeatProto.getRecovery()) {
      this.evaluatorControlHandler.setRemoteID(evaluatorRID);
      this.stateManager.setRunning();
      this.driverStatusManager.oneContainerRecovered();
      final int numRecoveredContainers=this.driverStatusManager.getNumRecoveredContainers();
      LOG.log(Level.FINE,"String_Node_Str",this.evaluatorId);
      final int expectedEvaluatorsNumber=this.driverStatusManager.getNumPreviousContainers();
      if (numRecoveredContainers > expectedEvaluatorsNumber) {
        LOG.log(Level.SEVERE,"String_Node_Str",new Object[]{expectedEvaluatorsNumber,numRecoveredContainers});
        throw new RuntimeException("String_Node_Str");
      }
 else       if (numRecoveredContainers == expectedEvaluatorsNumber) {
        LOG.log(Level.INFO,"String_Node_Str",expectedEvaluatorsNumber);
        this.driverStatusManager.setRestartCompleted();
        this.messageDispatcher.OnDriverRestartCompleted(new DriverRestartCompleted(System.currentTimeMillis()));
      }
 else {
        LOG.log(Level.INFO,"String_Node_Str",new Object[]{expectedEvaluatorsNumber,numRecoveredContainers});
      }
    }
    if (this.stateManager.isSubmitted()) {
      this.evaluatorControlHandler.setRemoteID(evaluatorRID);
      this.stateManager.setRunning();
      LOG.log(Level.FINEST,"String_Node_Str",this.evaluatorId);
    }
    if (evaluatorHeartbeatProto.hasEvaluatorStatus()) {
      this.onEvaluatorStatusMessage(evaluatorHeartbeatProto.getEvaluatorStatus());
    }
    final boolean informClientOfNewContexts=!evaluatorHeartbeatProto.hasTaskStatus();
    this.contextRepresenters.onContextStatusMessages(evaluatorHeartbeatProto.getContextStatusList(),informClientOfNewContexts);
    if (evaluatorHeartbeatProto.hasTaskStatus()) {
      this.onTaskStatusMessage(evaluatorHeartbeatProto.getTaskStatus());
    }
    LOG.log(Level.FINE,"String_Node_Str",this.getId());
  }
}