Program: 10044
Project: 10044
Buggy source:
@Override @SuppressWarnings("String_Node_Str") public ELDescriptionTree clone(){
  ELDescriptionTree treeClone=new ELDescriptionTree(rs);
  Map<ELDescriptionNode,ELDescriptionNode> cloneMap=new HashMap<ELDescriptionNode,ELDescriptionNode>();
  for (int i=1; i <= maxLevel; i++) {
    Set<ELDescriptionNode> tmp=levelNodeMapping.get(i);
    for (    ELDescriptionNode node : tmp) {
      ELDescriptionNode nodeNew=new ELDescriptionNode();
      cloneMap.put(node,nodeNew);
    }
  }
  ELDescriptionNode newRoot=null;
  for (  Entry<ELDescriptionNode,ELDescriptionNode> entry : cloneMap.entrySet()) {
    ELDescriptionNode oldNode=entry.getKey();
    ELDescriptionNode newNode=entry.getValue();
    newNode.tree=treeClone;
    newNode.level=oldNode.level;
    newNode.label=(TreeSet<NamedClass>)oldNode.label.clone();
    if (oldNode.parent != null) {
      newNode.parent=cloneMap.get(oldNode.parent);
    }
 else {
      newRoot=newNode;
    }
    for (    ELDescriptionNode node : oldNode.in) {
      newNode.in.add(cloneMap.get(node));
    }
    for (    ELDescriptionNode node : oldNode.inSC1) {
      newNode.inSC1.add(cloneMap.get(node));
    }
    for (    ELDescriptionNode node : oldNode.inSC2) {
      newNode.inSC2.add(cloneMap.get(node));
    }
    for (    ELDescriptionNode node : oldNode.out) {
      newNode.out.add(cloneMap.get(node));
    }
    for (    ELDescriptionNode node : oldNode.outSC1) {
      newNode.outSC1.add(cloneMap.get(node));
    }
    for (    ELDescriptionNode node : oldNode.outSC2) {
      newNode.outSC2.add(cloneMap.get(node));
    }
    for (    ELDescriptionEdge edge : oldNode.edges) {
      newNode.edges.add(new ELDescriptionEdge(edge.getLabel(),cloneMap.get(edge.getNode())));
    }
  }
  treeClone.rootNode=newRoot;
  treeClone.maxLevel=maxLevel;
  treeClone.nodes=new HashSet<ELDescriptionNode>(nodes);
  for (int i=1; i <= maxLevel; i++) {
    Set<ELDescriptionNode> oldNodes=levelNodeMapping.get(i);
    Set<ELDescriptionNode> newNodes=new HashSet<ELDescriptionNode>();
    for (    ELDescriptionNode oldNode : oldNodes) {
      newNodes.add(cloneMap.get(oldNode));
    }
    treeClone.levelNodeMapping.put(i,newNodes);
  }
  return treeClone;
}

Fixed version (ground truth):
@Override @SuppressWarnings("String_Node_Str") public ELDescriptionTree clone(){
  ELDescriptionTree treeClone=new ELDescriptionTree(rs);
  Map<ELDescriptionNode,ELDescriptionNode> cloneMap=new HashMap<ELDescriptionNode,ELDescriptionNode>();
  for (int i=1; i <= maxLevel; i++) {
    Set<ELDescriptionNode> tmp=levelNodeMapping.get(i);
    for (    ELDescriptionNode node : tmp) {
      ELDescriptionNode nodeNew=new ELDescriptionNode();
      cloneMap.put(node,nodeNew);
    }
  }
  ELDescriptionNode newRoot=null;
  for (  Entry<ELDescriptionNode,ELDescriptionNode> entry : cloneMap.entrySet()) {
    ELDescriptionNode oldNode=entry.getKey();
    ELDescriptionNode newNode=entry.getValue();
    newNode.tree=treeClone;
    newNode.level=oldNode.level;
    newNode.label=(TreeSet<NamedClass>)oldNode.label.clone();
    if (oldNode.parent != null) {
      newNode.parent=cloneMap.get(oldNode.parent);
    }
 else {
      newRoot=newNode;
    }
    for (    ELDescriptionNode node : oldNode.in) {
      newNode.in.add(cloneMap.get(node));
    }
    for (    ELDescriptionNode node : oldNode.inSC1) {
      newNode.inSC1.add(cloneMap.get(node));
    }
    for (    ELDescriptionNode node : oldNode.inSC2) {
      newNode.inSC2.add(cloneMap.get(node));
    }
    for (    ELDescriptionNode node : oldNode.out) {
      newNode.out.add(cloneMap.get(node));
    }
    for (    ELDescriptionNode node : oldNode.outSC1) {
      newNode.outSC1.add(cloneMap.get(node));
    }
    for (    ELDescriptionNode node : oldNode.outSC2) {
      newNode.outSC2.add(cloneMap.get(node));
    }
    for (    ELDescriptionEdge edge : oldNode.edges) {
      newNode.edges.add(new ELDescriptionEdge(edge.getLabel(),cloneMap.get(edge.getNode())));
    }
  }
  treeClone.rootNode=newRoot;
  treeClone.maxLevel=maxLevel;
  treeClone.nodes=new HashSet<ELDescriptionNode>();
  for (  ELDescriptionNode oldNode : nodes) {
    treeClone.nodes.add(cloneMap.get(oldNode));
  }
  for (int i=1; i <= maxLevel; i++) {
    Set<ELDescriptionNode> oldNodes=levelNodeMapping.get(i);
    Set<ELDescriptionNode> newNodes=new HashSet<ELDescriptionNode>();
    for (    ELDescriptionNode oldNode : oldNodes) {
      newNodes.add(cloneMap.get(oldNode));
    }
    treeClone.levelNodeMapping.put(i,newNodes);
  }
  return treeClone;
}