Program: 17089
Project: 17089
Buggy source:
private boolean mapChains(List<Group> seqRes,List<Group> atomRes,SequencePair<ProteinSequence,AminoAcidCompound> pair) throws StructureException {
  List<Group> seqResGroups=seqRes;
  int aligLength=pair.getLength();
  boolean noMatchFound=true;
  Compound gapSymbol=AminoAcidCompoundSet.getAminoAcidCompoundSet().getCompoundForString("String_Node_Str");
  for (int i=1; i <= aligLength; i++) {
    Compound s=pair.getCompoundAt(1,i);
    Compound a=pair.getCompoundAt(2,i);
    int posSeq=pair.getIndexInQueryAt(i) - 1;
    int posAtom=pair.getIndexInTargetAt(i) - 1;
    if (s.equals(gapSymbol) || a.equals(gapSymbol)) {
      continue;
    }
    if (s.equals(a)) {
      Group s1=seqRes.get(posSeq);
      Group a1=atomRes.get(posAtom);
      String pdbNameS=s1.getPDBName();
      String pdbNameA=a1.getPDBName();
      if (pdbNameS == null || pdbNameA == null) {
        System.err.println("String_Node_Str" + posSeq + "String_Node_Str"+ s1+ "String_Node_Str"+ a1+ "String_Node_Str"+ posAtom);
        throw new StructureException("String_Node_Str");
      }
      if (!pdbNameA.equals(pdbNameS)) {
        if (!pdbNameA.trim().equals(pdbNameS.trim())) {
          System.err.println(s1 + "String_Node_Str" + posSeq+ "String_Node_Str"+ a1+ "String_Node_Str"+ posAtom+ "String_Node_Str"+ s+ "String_Node_Str"+ a);
          if (s1.getType().equals(HetatomImpl.type) && a1.getType().equals(HetatomImpl.type)) {
            System.err.println("String_Node_Str");
          }
 else {
            System.err.println("String_Node_Str" + s1 + "String_Node_Str"+ a1);
          }
        }
      }
      seqResGroups.set(posSeq,a1);
      noMatchFound=false;
    }
  }
  if (noMatchFound) {
    if (DEBUG)     System.out.println("String_Node_Str");
  }
  return noMatchFound;
}

Fixed version (ground truth):
private boolean mapChains(List<Group> seqResGroups,List<Group> atomRes,SequencePair<ProteinSequence,AminoAcidCompound> pair,Map<Integer,Integer> seqresIndexPosition,Map<Integer,Integer> atomIndexPosition) throws StructureException {
  int aligLength=pair.getLength();
  boolean noMatchFound=true;
  Compound gapSymbol=AminoAcidCompoundSet.getAminoAcidCompoundSet().getCompoundForString("String_Node_Str");
  mainLoop:   for (int i=1; i <= aligLength; i++) {
    Compound s=pair.getCompoundAt(1,i);
    Compound a=pair.getCompoundAt(2,i);
    int posSeq=pair.getIndexInQueryAt(i) - 1;
    int posAtom=pair.getIndexInTargetAt(i) - 1;
    if (s.equals(gapSymbol) || a.equals(gapSymbol)) {
      continue;
    }
    if (s.equals(a)) {
      Group s1=seqResGroups.get(seqresIndexPosition.get(posSeq));
      Group a1=atomRes.get(atomIndexPosition.get(posAtom));
      if (s1 == null || a1 == null) {
        System.err.println("String_Node_Str" + i + "String_Node_Str"+ s+ "String_Node_Str"+ posSeq+ "String_Node_Str"+ s1+ "String_Node_Str"+ posAtom+ "String_Node_Str"+ a1);
        continue mainLoop;
      }
      String pdbNameS=s1.getPDBName();
      String pdbNameA=a1.getPDBName();
      if (pdbNameS == null || pdbNameA == null) {
        System.err.println("String_Node_Str" + posSeq + "String_Node_Str"+ s1+ "String_Node_Str"+ a1+ "String_Node_Str"+ posAtom);
        throw new StructureException("String_Node_Str");
      }
      if (!pdbNameA.equals(pdbNameS)) {
        if (!pdbNameA.trim().equals(pdbNameS.trim())) {
          System.err.println(s1 + "String_Node_Str" + posSeq+ "String_Node_Str"+ a1+ "String_Node_Str"+ posAtom+ "String_Node_Str"+ s+ "String_Node_Str"+ a);
          if (s1.getType().equals(HetatomImpl.type) && a1.getType().equals(HetatomImpl.type)) {
            System.err.println("String_Node_Str");
          }
 else {
            System.err.println("String_Node_Str" + s1 + "String_Node_Str"+ a1);
          }
        }
      }
      seqResGroups.set(seqresIndexPosition.get(posSeq),a1);
      noMatchFound=false;
    }
  }
  if (noMatchFound) {
    if (DEBUG)     System.out.println("String_Node_Str");
  }
  return noMatchFound;
}