Program: 53639
Project: 53639
Buggy source:
private void fillEmulationLink(LinkDataDuplexMap linkDataDuplexMap){
  logger.debug("String_Node_Str",this.emulationLinkMarker);
  List<LinkData> emulationLinkDataList=findEmulationLinkData(linkDataDuplexMap);
  for (  LinkData emulationLinkData : emulationLinkDataList) {
    LinkCallDataMap beforeImage=emulationLinkData.getLinkCallDataMap();
    logger.debug("String_Node_Str",beforeImage);
    emulationLinkData.resetLinkData();
    LinkKey findLinkKey=new LinkKey(emulationLinkData.getFromApplication(),emulationLinkData.getToApplication());
    LinkData targetLinkData=linkDataDuplexMap.getTargetLinkData(findLinkKey);
    if (targetLinkData == null) {
      logger.error("String_Node_Str",findLinkKey);
      continue;
    }
    LinkCallDataMap targetList=targetLinkData.getLinkCallDataMap();
    Collection<LinkCallData> beforeLinkDataList=beforeImage.getLinkDataList();
    LinkCallData beforeLinkCallData=beforeLinkDataList.iterator().next();
    for (    LinkCallData agentHistogram : targetList.getLinkDataList()) {
      Collection<TimeHistogram> timeHistogramList=agentHistogram.getTimeHistogram();
      LinkCallDataMap linkCallDataMap=emulationLinkData.getLinkCallDataMap();
      if (logger.isDebugEnabled()) {
        logger.debug("String_Node_Str",beforeLinkCallData);
        logger.debug("String_Node_Str",agentHistogram);
        logger.debug("String_Node_Str",agentHistogram.getTarget(),agentHistogram.getTargetServiceType(),beforeLinkCallData.getTarget(),beforeLinkCallData.getTargetServiceType().getCode());
      }
      linkCallDataMap.addCallData(agentHistogram.getTarget(),agentHistogram.getTargetServiceType(),beforeLinkCallData.getTarget(),beforeLinkCallData.getTargetServiceType(),timeHistogramList);
    }
  }
}

Fixed version (ground truth):
private void fillEmulationLink(LinkDataDuplexMap linkDataDuplexMap,Range range){
  logger.debug("String_Node_Str",this.emulationLinkMarker);
  List<LinkData> emulationLinkDataList=findEmulationLinkData(linkDataDuplexMap);
  for (  LinkData emulationLinkData : emulationLinkDataList) {
    LinkCallDataMap beforeImage=emulationLinkData.getLinkCallDataMap();
    logger.debug("String_Node_Str",beforeImage);
    emulationLinkData.resetLinkData();
    LinkKey findLinkKey=new LinkKey(emulationLinkData.getFromApplication(),emulationLinkData.getToApplication());
    LinkData targetLinkData=linkDataDuplexMap.getTargetLinkData(findLinkKey);
    if (targetLinkData == null) {
      final Application targetApplication=emulationLinkData.getToApplication();
      final LinkDataMap callee=mapStatisticsCalleeDao.selectCallee(targetApplication,range);
      targetLinkData=callee.getLinkData(findLinkKey);
      if (targetLinkData == null) {
        logger.error("String_Node_Str",findLinkKey);
        continue;
      }
    }
    LinkCallDataMap targetList=targetLinkData.getLinkCallDataMap();
    Collection<LinkCallData> beforeLinkDataList=beforeImage.getLinkDataList();
    LinkCallData beforeLinkCallData=beforeLinkDataList.iterator().next();
    for (    LinkCallData agentHistogram : targetList.getLinkDataList()) {
      Collection<TimeHistogram> timeHistogramList=agentHistogram.getTimeHistogram();
      LinkCallDataMap linkCallDataMap=emulationLinkData.getLinkCallDataMap();
      if (logger.isDebugEnabled()) {
        logger.debug("String_Node_Str",beforeLinkCallData);
        logger.debug("String_Node_Str",agentHistogram);
        logger.debug("String_Node_Str",agentHistogram.getTarget(),agentHistogram.getTargetServiceType(),beforeLinkCallData.getTarget(),beforeLinkCallData.getTargetServiceType().getCode());
      }
      linkCallDataMap.addCallData(agentHistogram.getTarget(),agentHistogram.getTargetServiceType(),beforeLinkCallData.getTarget(),beforeLinkCallData.getTargetServiceType(),timeHistogramList);
    }
  }
}