Program: 142994
Project: 142994
Buggy source:
public void closeLoader(){
  if (parameters.getEdgeDefault().equals(EdgeDefault.UNDIRECTED)) {
    for (    EdgeDraftImpl edge : edgeMap.values().toArray(new EdgeDraftImpl[0])) {
      String oppositekey=edge.getTarget().getId() + "String_Node_Str" + edge.getSource().getId();
      EdgeDraftImpl opposite=edgeSourceTargetMap.get(oppositekey);
      if (opposite != null) {
        edgeMap.remove(opposite.getId());
        edgeSourceTargetMap.remove(oppositekey);
      }
    }
  }
 else   if (parameters.getEdgeDefault().equals(EdgeDefault.MIXED)) {
    for (    EdgeDraftImpl edge : edgeMap.values().toArray(new EdgeDraftImpl[0])) {
      if (edge.getType() == null) {
        edge.setType(EdgeDraft.EdgeType.UNDIRECTED);
      }
      if (edge.getType().equals(EdgeDraft.EdgeType.UNDIRECTED)) {
        String oppositekey=edge.getTarget().getId() + "String_Node_Str" + edge.getSource().getId();
        EdgeDraftImpl opposite=edgeSourceTargetMap.get(oppositekey);
        if (opposite != null) {
          edgeMap.remove(opposite.getId());
          edgeSourceTargetMap.remove(oppositekey);
        }
      }
    }
  }
  LinkedHashMap<String,NodeDraftImpl> sortedNodeMap=new LinkedHashMap<String,NodeDraftImpl>();
  ArrayList<NodeDraftImpl> sortedMapValues=new ArrayList<NodeDraftImpl>(nodeMap.values());
  Collections.sort(sortedMapValues,new Comparator<NodeDraftImpl>(){
    public int compare(    NodeDraftImpl o1,    NodeDraftImpl o2){
      return new Integer(o1.getHeight()).compareTo(o2.getHeight());
    }
  }
);
  for (  NodeDraftImpl n : sortedMapValues) {
    sortedNodeMap.put(n.getId(),n);
  }
  nodeMap=sortedNodeMap;
}

Fixed version (ground truth):
public void closeLoader(){
  if (parameters.getEdgeDefault().equals(EdgeDefault.UNDIRECTED)) {
    for (Iterator<EdgeDraftImpl> itr=edgeMap.values().iterator(); itr.hasNext(); ) {
      EdgeDraftImpl edge=itr.next();
      String oppositekey=edge.getTarget().getId() + "String_Node_Str" + edge.getSource().getId();
      EdgeDraftImpl opposite=edgeSourceTargetMap.get(oppositekey);
      if (opposite != null) {
        itr.remove();
        edgeSourceTargetMap.remove(edge.getSource().getId() + "String_Node_Str" + edge.getTarget().getId());
      }
    }
  }
 else   if (parameters.getEdgeDefault().equals(EdgeDefault.MIXED)) {
    for (    EdgeDraftImpl edge : edgeMap.values().toArray(new EdgeDraftImpl[0])) {
      if (edge.getType() == null) {
        edge.setType(EdgeDraft.EdgeType.UNDIRECTED);
      }
      if (edge.getType().equals(EdgeDraft.EdgeType.UNDIRECTED)) {
        String oppositekey=edge.getTarget().getId() + "String_Node_Str" + edge.getSource().getId();
        EdgeDraftImpl opposite=edgeSourceTargetMap.get(oppositekey);
        if (opposite != null) {
          edgeMap.remove(opposite.getId());
          edgeSourceTargetMap.remove(oppositekey);
        }
      }
    }
  }
  LinkedHashMap<String,NodeDraftImpl> sortedNodeMap=new LinkedHashMap<String,NodeDraftImpl>();
  ArrayList<NodeDraftImpl> sortedMapValues=new ArrayList<NodeDraftImpl>(nodeMap.values());
  Collections.sort(sortedMapValues,new Comparator<NodeDraftImpl>(){
    public int compare(    NodeDraftImpl o1,    NodeDraftImpl o2){
      return new Integer(o1.getHeight()).compareTo(o2.getHeight());
    }
  }
);
  for (  NodeDraftImpl n : sortedMapValues) {
    sortedNodeMap.put(n.getId(),n);
  }
  nodeMap=sortedNodeMap;
}