Program: 17756
Project: 17756
Buggy source:
/** 
 * Get shadow links into their columns:
 */
private int shadowLinkToColumn(int currDrainRow,SortedMap<Integer,SortedSet<Integer>> rankedLinks,Map<Link,SortedMap<FabricLink.AugRelation,FabricLink>> relsForPair,String relOnly,List<String> allRels,int colCount,HashMap<Integer,String> rowToTarg,BioFabricNetwork.RelayoutBuildData rbd,TreeMap<Integer,FabricLink> linkOrder){
  Iterator<Integer> rlit=rankedLinks.keySet().iterator();
  while (rlit.hasNext()) {
    Integer topRow=rlit.next();
    SortedSet<Integer> perSrc=rankedLinks.get(topRow);
    Iterator<Integer> psit=perSrc.iterator();
    while (psit.hasNext()) {
      Integer botRow=psit.next();
      if (botRow.intValue() != currDrainRow) {
        continue;
      }
      if (topRow.equals(botRow)) {
        continue;
      }
      String topNode=rowToTarg.get(topRow);
      String botNode=rowToTarg.get(botRow);
      SortedMap<FabricLink.AugRelation,FabricLink> forPair1=relsForPair.get(new Link(topNode,botNode));
      if (forPair1 != null) {
        Iterator<FabricLink> fp1it=forPair1.values().iterator();
        while (fp1it.hasNext()) {
          FabricLink nextLink=fp1it.next();
          if (nextLink.isShadow()) {
            if (bestSuffixMatch(nextLink,relOnly,allRels)) {
              Integer shadowKey=Integer.valueOf(colCount++);
              linkOrder.put(shadowKey,nextLink);
            }
          }
        }
      }
      if (!topNode.equals(botNode)) {
        SortedMap<FabricLink.AugRelation,FabricLink> forPair2=relsForPair.get(new Link(botNode,topNode));
        if (forPair2 != null) {
          Iterator<FabricLink> fp2it=forPair2.values().iterator();
          while (fp2it.hasNext()) {
            FabricLink nextLink=fp2it.next();
            if (nextLink.isShadow()) {
              if (bestSuffixMatch(nextLink,relOnly,allRels)) {
                Integer shadowKey=Integer.valueOf(colCount++);
                linkOrder.put(shadowKey,nextLink);
              }
            }
          }
        }
      }
 else {
        throw new IllegalStateException();
      }
    }
  }
  return (colCount);
}

Fixed version (ground truth):
/** 
 * Get shadow links into their columns:
 */
private int shadowLinkToColumn(int currDrainRow,SortedMap<Integer,SortedSet<Integer>> rankedLinks,Map<Link,SortedMap<FabricLink.AugRelation,FabricLink>> relsForPair,String relOnly,List<String> allRels,int colCount,HashMap<Integer,String> rowToTarg,BioFabricNetwork.RelayoutBuildData rbd,TreeMap<Integer,FabricLink> linkOrder){
  Iterator<Integer> rlit=rankedLinks.keySet().iterator();
  while (rlit.hasNext()) {
    Integer topRow=rlit.next();
    SortedSet<Integer> perSrc=rankedLinks.get(topRow);
    Iterator<Integer> psit=perSrc.iterator();
    while (psit.hasNext()) {
      Integer botRow=psit.next();
      if (botRow.intValue() != currDrainRow) {
        continue;
      }
      if (topRow.equals(botRow)) {
        continue;
      }
      String topNode=rowToTarg.get(topRow);
      String botNode=rowToTarg.get(botRow);
      SortedMap<FabricLink.AugRelation,FabricLink> forPair1=relsForPair.get(new Link(topNode,botNode));
      if (forPair1 != null) {
        Iterator<FabricLink> fp1it=forPair1.values().iterator();
        while (fp1it.hasNext()) {
          FabricLink nextLink=fp1it.next();
          if (nextLink.isShadow()) {
            String augRel=nextLink.getAugRelation().relation;
            if (bestSuffixMatch(augRel,relOnly,allRels)) {
              Integer shadowKey=Integer.valueOf(colCount++);
              linkOrder.put(shadowKey,nextLink);
            }
          }
        }
      }
      if (!topNode.equals(botNode)) {
        SortedMap<FabricLink.AugRelation,FabricLink> forPair2=relsForPair.get(new Link(botNode,topNode));
        if (forPair2 != null) {
          Iterator<FabricLink> fp2it=forPair2.values().iterator();
          while (fp2it.hasNext()) {
            FabricLink nextLink=fp2it.next();
            if (nextLink.isShadow()) {
              String augRel=nextLink.getAugRelation().relation;
              if (bestSuffixMatch(augRel,relOnly,allRels)) {
                Integer shadowKey=Integer.valueOf(colCount++);
                linkOrder.put(shadowKey,nextLink);
              }
            }
          }
        }
      }
 else {
        throw new IllegalStateException();
      }
    }
  }
  return (colCount);
}