Program: 96687
Project: 96687
Buggy source:
private DispoItemData buildNewItem(DispoItemData destItem,DispoItem sourceItem,boolean isCoverageCopy,OperationReport report,boolean isSameDiscrepancies){
  boolean isChangesMade=false;
  DispoItemData newItem=initNewItem(destItem,sourceItem);
  List<DispoAnnotationData> newAnnotations=newItem.getAnnotationsList();
  List<DispoAnnotationData> sourceAnnotations=sourceItem.getAnnotationsList();
  Set<String> destDefaultAnntationLocations=getDefaultAnnotations(newItem);
  Map<String,Integer> placeHolderAnnotationLocations=getPlaceHolderAnnotations(newItem);
  List<String> destDiscrepanciesTextOnly=discrepanciesTextOnly(destItem.getDiscrepanciesList());
  for (  DispoAnnotationData sourceAnnotation : sourceAnnotations) {
    String sourceLocation=sourceAnnotation.getLocationRefs();
    if (DispoUtil.isDefaultAnotation(sourceAnnotation) || !Strings.isValid(sourceAnnotation.getResolutionType())) {
      if (!destDefaultAnntationLocations.contains(sourceLocation)) {
        report.addEntry(destItem.getName(),String.format("String_Node_Str",sourceAnnotation.getLocationRefs()),IGNORE);
      }
    }
 else     if (destDefaultAnntationLocations.contains(sourceLocation)) {
      report.addEntry(destItem.getName(),String.format("String_Node_Str",sourceAnnotation.getLocationRefs()),IGNORE);
    }
 else     if (newAnnotations.toString().contains(sourceAnnotation.getGuid())) {
      report.addEntry(destItem.getName(),String.format("String_Node_Str",sourceAnnotation.getLocationRefs(),sourceAnnotation.getGuid()),IGNORE);
    }
 else {
      if (isSameDiscrepancies && isCoveredDiscrepanciesExistInDest(destDiscrepanciesTextOnly,sourceItem,sourceAnnotation,report)) {
        DispoAnnotationData newAnnotation=sourceAnnotation;
        if (destDefaultAnntationLocations.contains(sourceLocation)) {
          String locationRefs=sourceAnnotation.getLocationRefs();
          Integer locationRefAsInt=Integer.valueOf(locationRefs);
          if (locationRefAsInt > 0) {
            newAnnotation.setLocationRefs(String.valueOf(locationRefAsInt * -1));
          }
          report.addEntry(destItem.getName(),String.format("String_Node_Str",locationRefs),WARNING);
        }
        connector.connectAnnotation(newAnnotation,newItem.getDiscrepanciesList());
        isChangesMade=true;
        int nextIndex;
        if (placeHolderAnnotationLocations.containsKey(sourceLocation)) {
          nextIndex=placeHolderAnnotationLocations.get(sourceLocation);
          newAnnotation.setIndex(nextIndex);
          newAnnotations.set(nextIndex,newAnnotation);
        }
 else {
          nextIndex=newAnnotations.size();
          newAnnotation.setIndex(nextIndex);
          newAnnotations.add(nextIndex,newAnnotation);
        }
      }
    }
  }
  if (isChangesMade) {
    newItem.setAnnotationsList(newAnnotations);
    String newStatus=connector.getItemStatus(newItem);
    newItem.setStatus(newStatus);
  }
 else   if (!isCoverageCopy) {
    newItem=destItem;
    newItem.setGuid(sourceItem.getGuid());
  }
 else {
    report.addEntry(destItem.getName(),"String_Node_Str",IGNORE);
    newItem=null;
  }
  return newItem;
}

Fixed version (ground truth):
private DispoItemData buildNewItem(DispoItemData destItem,DispoItem sourceItem,boolean isCoverageCopy,OperationReport report,boolean isSameDiscrepancies){
  boolean isChangesMade=false;
  DispoItemData newItem=initNewItem(destItem,sourceItem);
  List<DispoAnnotationData> newAnnotations=newItem.getAnnotationsList();
  List<DispoAnnotationData> sourceAnnotations=sourceItem.getAnnotationsList();
  Set<String> destDefaultAnntationLocations=getDefaultAnnotations(newItem);
  Map<String,Integer> nonDefaultAnnotationLocations=getNonDefaultAnnotations(newItem);
  List<String> destDiscrepanciesTextOnly=discrepanciesTextOnly(destItem.getDiscrepanciesList());
  for (  DispoAnnotationData sourceAnnotation : sourceAnnotations) {
    String sourceLocation=sourceAnnotation.getLocationRefs();
    if (DispoUtil.isDefaultAnotation(sourceAnnotation) || !Strings.isValid(sourceAnnotation.getResolutionType())) {
      if (!destDefaultAnntationLocations.contains(sourceLocation)) {
        report.addEntry(destItem.getName(),String.format("String_Node_Str",sourceAnnotation.getLocationRefs()),IGNORE);
      }
    }
 else     if (destDefaultAnntationLocations.contains(sourceLocation)) {
      report.addEntry(destItem.getName(),String.format("String_Node_Str",sourceAnnotation.getLocationRefs()),IGNORE);
    }
 else     if (newAnnotations.toString().contains(sourceAnnotation.getGuid())) {
      report.addEntry(destItem.getName(),String.format("String_Node_Str",sourceAnnotation.getLocationRefs(),sourceAnnotation.getGuid()),IGNORE);
    }
 else {
      if (isSameDiscrepancies && isCoveredDiscrepanciesExistInDest(destDiscrepanciesTextOnly,sourceItem,sourceAnnotation,report)) {
        DispoAnnotationData newAnnotation=sourceAnnotation;
        if (destDefaultAnntationLocations.contains(sourceLocation)) {
          String locationRefs=sourceAnnotation.getLocationRefs();
          Integer locationRefAsInt=Integer.valueOf(locationRefs);
          if (locationRefAsInt > 0) {
            newAnnotation.setLocationRefs(String.valueOf(locationRefAsInt * -1));
          }
          report.addEntry(destItem.getName(),String.format("String_Node_Str",locationRefs),WARNING);
        }
        connector.connectAnnotation(newAnnotation,newItem.getDiscrepanciesList());
        isChangesMade=true;
        int nextIndex;
        if (nonDefaultAnnotationLocations.containsKey(sourceLocation)) {
          nextIndex=nonDefaultAnnotationLocations.get(sourceLocation);
          newAnnotation.setIndex(nextIndex);
          newAnnotations.set(nextIndex,newAnnotation);
        }
 else {
          nextIndex=newAnnotations.size();
          newAnnotation.setIndex(nextIndex);
          newAnnotations.add(nextIndex,newAnnotation);
        }
      }
    }
  }
  if (isChangesMade) {
    newItem.setAnnotationsList(newAnnotations);
    String newStatus=connector.getItemStatus(newItem);
    newItem.setStatus(newStatus);
  }
 else   if (!isCoverageCopy) {
    newItem=destItem;
    newItem.setGuid(sourceItem.getGuid());
  }
 else {
    report.addEntry(destItem.getName(),"String_Node_Str",IGNORE);
    newItem=null;
  }
  return newItem;
}