Program: 113543
Project: 113543
Buggy source:
@Override protected void processMethod(StageRequest method){
  if (method.getStageMethod() == STAGEOP_COORD_XCHG_REQUEST) {
    UDPMessage msg=(UDPMessage)method.getArgs()[0];
    final ReusableBuffer data=msg.getPayload();
    try {
      if (msg.isRequest()) {
        sendVivaldiResponse(msg,this.vNode.getCoordinates());
      }
 else       if (msg.isResponse()) {
        xtreemfs_pingResponse response=(xtreemfs_pingResponse)msg.getResponseData();
        VivaldiCoordinates coordinatesJ=response.getRemote_coordinates();
        SentRequest correspondingReq=sentRequests.remove(msg.getAddress());
        if (correspondingReq != null) {
          long now=System.currentTimeMillis();
          long estimatedRTT=now - correspondingReq.getSystemTime();
          if (estimatedRTT == 0) {
            estimatedRTT=1;
          }
          VivaldiRetry prevRetry=sentRetries.get(msg.getAddress());
          if (!vNode.recalculatePosition(coordinatesJ,estimatedRTT,false)) {
            if (prevRetry == null) {
              sentRetries.put(msg.getAddress(),new VivaldiRetry(estimatedRTT));
            }
 else {
              prevRetry.addRTT(estimatedRTT);
              prevRetry.setRetried(false);
              if (prevRetry.numberOfRetries() > MAX_RETRIES_FOR_A_REQUEST) {
                forceVivaldiRecalculation(coordinatesJ,prevRetry.getRTTs());
                sentRetries.remove(msg.getAddress());
              }
            }
          }
 else {
            if (Logging.isInfo()) {
              Logging.logMessage(Logging.LEVEL_DEBUG,this,String.format("String_Node_Str",estimatedRTT,VivaldiNode.calculateDistance(vNode.getCoordinates(),coordinatesJ),vNode.getCoordinates().getX_coordinate(),vNode.getCoordinates().getY_coordinate(),vNode.getCoordinates().getLocal_error(),coordinatesJ.getX_coordinate(),coordinatesJ.getY_coordinate(),coordinatesJ.getLocal_error(),msg.getAddress().getHostName()));
            }
            if (prevRetry != null) {
              sentRetries.remove(msg.getAddress());
            }
          }
        }
      }
    }
  finally {
      if (data != null) {
        BufferPool.free(data);
      }
    }
  }
 else   if (method.getStageMethod() == STAGEOP_TCP_VIVALID_PING) {
    VivaldiPingCallback cb=(VivaldiPingCallback)method.getCallback();
    VivaldiCoordinates remoteCoordinates=(VivaldiCoordinates)method.getArgs()[0];
    cb.coordinatesCallback(remoteCoordinates,null);
  }
 else {
    throw new RuntimeException("String_Node_Str");
  }
}

Fixed version (ground truth):
@Override protected void processMethod(StageRequest method){
  if (method.getStageMethod() == STAGEOP_COORD_XCHG_REQUEST) {
    UDPMessage msg=(UDPMessage)method.getArgs()[0];
    final ReusableBuffer data=msg.getPayload();
    try {
      if (msg.isRequest()) {
        sendVivaldiResponse(msg,this.vNode.getCoordinates());
      }
 else       if (msg.isResponse()) {
        xtreemfs_pingResponse response=(xtreemfs_pingResponse)msg.getResponseData();
        VivaldiCoordinates coordinatesJ=response.getRemote_coordinates();
        SentRequest correspondingReq=sentRequests.remove(msg.getAddress());
        if (correspondingReq != null) {
          long now=System.currentTimeMillis();
          long estimatedRTT=now - correspondingReq.getSystemTime();
          if (estimatedRTT == 0) {
            estimatedRTT=1;
          }
          VivaldiRetry prevRetry=sentRetries.get(msg.getAddress());
          if (!vNode.recalculatePosition(coordinatesJ,estimatedRTT,false)) {
            if (prevRetry == null) {
              sentRetries.put(msg.getAddress(),new VivaldiRetry(estimatedRTT));
            }
 else {
              prevRetry.addRTT(estimatedRTT);
              prevRetry.setRetried(false);
              if (prevRetry.numberOfRetries() > MAX_RETRIES_FOR_A_REQUEST) {
                forceVivaldiRecalculation(coordinatesJ,prevRetry.getRTTs());
                sentRetries.remove(msg.getAddress());
              }
            }
          }
 else {
            if (Logging.isDebug()) {
              Logging.logMessage(Logging.LEVEL_DEBUG,this,String.format("String_Node_Str",estimatedRTT,VivaldiNode.calculateDistance(vNode.getCoordinates(),coordinatesJ),vNode.getCoordinates().getX_coordinate(),vNode.getCoordinates().getY_coordinate(),vNode.getCoordinates().getLocal_error(),coordinatesJ.getX_coordinate(),coordinatesJ.getY_coordinate(),coordinatesJ.getLocal_error(),msg.getAddress().getHostName()));
            }
            if (prevRetry != null) {
              sentRetries.remove(msg.getAddress());
            }
          }
        }
      }
    }
  finally {
      if (data != null) {
        BufferPool.free(data);
      }
    }
  }
 else   if (method.getStageMethod() == STAGEOP_TCP_VIVALID_PING) {
    VivaldiPingCallback cb=(VivaldiPingCallback)method.getCallback();
    VivaldiCoordinates remoteCoordinates=(VivaldiCoordinates)method.getArgs()[0];
    cb.coordinatesCallback(remoteCoordinates,null);
  }
 else {
    throw new RuntimeException("String_Node_Str");
  }
}