Program: 16279
Project: 16279
Buggy source:
/** 
 * Handler for the SITE records.  <pre> COLUMNS	DATA TYPE 		FIELD 		DEFINITION --------------------------------------------------------------------------------- 1 - 6	Record name 	"SITE " 8 - 10 	Integer 		seqNum 		Sequence number. 12 - 14 	LString(3)		siteID 		Site name. 16 - 17 	Integer 		numRes 		Number of residues that compose the siteResidues. 19 - 21 	Residue name	resName1	Residue name for first residue that creates the siteResidues. 23 		Character 		chainID1 	Chain identifier for first residue of siteResidues. 24 - 27 	Integer 		seq1 		Residue sequence number for first residue of the siteResidues. 28 		AChar 			iCode1 		Insertion code for first residue of the siteResidues. example: 1         2         3         4         5         6         7         8 12345678901234567890123456789012345678901234567890123456789012345678901234567890 SITE     1 AC1  3 HIS A  94 HIS A   96  HIS A 119 SITE     1 AC2  5 ASN A  62 GLY A   63  HIS A  64  HOH A 328 SITE     2 AC2  5 HOH A 634 SITE     1 AC3  5 GLN A 136 GLN A  137  PRO A 138  GLU A 205 SITE     2 AC3  5 CYS A 206 SITE     1 AC4 11 HIS A  64 HIS A   94  HIS A  96  HIS A 119 SITE     2 AC4 11 LEU A 198 THR A  199  THR A 200  TRP A 209 SITE     3 AC4 11 HOH A 572 HOH A  582  HOH A 635 </pre>
 * @param line the SITE line record being currently read
 * @author Amr AL-Hossary
 * @author Jules Jacobsen
 */
private void pdb_SITE_Handler(String line){
  if (params.isHeaderOnly())   return;
  logger.debug("String_Node_Str" + line);
  String siteID=line.substring(11,14);
  List<ResidueNumber> siteResidues=siteToResidueMap.get(siteID);
  if (siteResidues == null || !siteToResidueMap.containsKey(siteID.trim())) {
    siteResidues=new ArrayList<ResidueNumber>();
    siteToResidueMap.put(siteID.trim(),siteResidues);
    logger.debug(String.format("String_Node_Str",siteID,siteResidues));
    logger.debug("String_Node_Str" + siteMap.size() + "String_Node_Str");
  }
  logger.debug(String.format("String_Node_Str",siteID));
  line=line.substring(18);
  String groupString=null;
  while (!(groupString=line.substring(0,10)).equals("String_Node_Str")) {
    logger.debug("String_Node_Str" + groupString + "String_Node_Str");
    String residueName=groupString.substring(0,3);
    Character aminoCode1=StructureTools.get1LetterCode(residueName);
    if (aminoCode1 != null) {
      if (aminoCode1.equals(StructureTools.UNKNOWN_GROUP_LABEL)) {
        aminoCode1=null;
      }
    }
    String chainId=groupString.substring(4,5);
    Integer resNum=Integer.valueOf(groupString.substring(5,9).trim());
    Character insCode=groupString.substring(9,10).charAt(0);
    logger.debug(String.format("String_Node_Str",siteID,residueName,resNum,insCode));
    ResidueNumber residueNumber=new ResidueNumber();
    logger.debug("String_Node_Str" + resNum + insCode+ "String_Node_Str");
    residueNumber.setChainName(chainId);
    residueNumber.setSeqNum(resNum);
    residueNumber.setInsCode(insCode);
    siteResidues.add(residueNumber);
    logger.debug("String_Node_Str" + residueNumber + "String_Node_Str"+ siteID);
    line=line.substring(11);
  }
  logger.debug("String_Node_Str" + siteToResidueMap.keySet().size() + "String_Node_Str");
  for (  String key : siteToResidueMap.keySet()) {
    logger.debug(key + "String_Node_Str" + siteToResidueMap.get(key));
  }
}

Fixed version (ground truth):
/** 
 * Handler for the SITE records. <br> <pre> COLUMNS	DATA TYPE 		FIELD 		DEFINITION --------------------------------------------------------------------------------- 1 - 6	Record name 	"SITE " 8 - 10 	Integer 		seqNum 		Sequence number. 12 - 14 	LString(3)		siteID 		Site name. 16 - 17 	Integer 		numRes 		Number of residues that compose the siteResidues. 19 - 21 	Residue name	resName1	Residue name for first residue that creates the siteResidues. 23 		Character 		chainID1 	Chain identifier for first residue of siteResidues. 24 - 27 	Integer 		seq1 		Residue sequence number for first residue of the siteResidues. 28 		AChar 			iCode1 		Insertion code for first residue of the siteResidues. example: 1         2         3         4         5         6         7         8 12345678901234567890123456789012345678901234567890123456789012345678901234567890 SITE     1 AC1  3 HIS A  94 HIS A   96  HIS A 119 SITE     1 AC2  5 ASN A  62 GLY A   63  HIS A  64  HOH A 328 SITE     2 AC2  5 HOH A 634 SITE     1 AC3  5 GLN A 136 GLN A  137  PRO A 138  GLU A 205 SITE     2 AC3  5 CYS A 206 SITE     1 AC4 11 HIS A  64 HIS A   94  HIS A  96  HIS A 119 SITE     2 AC4 11 LEU A 198 THR A  199  THR A 200  TRP A 209 SITE     3 AC4 11 HOH A 572 HOH A  582  HOH A 635 </pre>
 * @param line the SITE line record being currently read
 * @author Amr AL-Hossary
 * @author Jules Jacobsen
 */
private void pdb_SITE_Handler(String line){
  if (params.isHeaderOnly())   return;
  logger.debug("String_Node_Str" + line);
  String siteID=line.substring(11,14);
  List<ResidueNumber> siteResidues=siteToResidueMap.get(siteID);
  if (siteResidues == null || !siteToResidueMap.containsKey(siteID.trim())) {
    siteResidues=new ArrayList<ResidueNumber>();
    siteToResidueMap.put(siteID.trim(),siteResidues);
    logger.debug(String.format("String_Node_Str",siteID,siteResidues));
    logger.debug("String_Node_Str" + siteMap.size() + "String_Node_Str");
  }
  logger.debug(String.format("String_Node_Str",siteID));
  line=line.substring(18);
  String groupString=null;
  while (!(groupString=line.substring(0,10)).equals("String_Node_Str")) {
    logger.debug("String_Node_Str" + groupString + "String_Node_Str");
    String residueName=groupString.substring(0,3);
    Character aminoCode1=StructureTools.get1LetterCode(residueName);
    if (aminoCode1 != null) {
      if (aminoCode1.equals(StructureTools.UNKNOWN_GROUP_LABEL)) {
        aminoCode1=null;
      }
    }
    String chainId=groupString.substring(4,5);
    Integer resNum=Integer.valueOf(groupString.substring(5,9).trim());
    Character insCode=groupString.substring(9,10).charAt(0);
    logger.debug(String.format("String_Node_Str",siteID,residueName,resNum,insCode));
    ResidueNumber residueNumber=new ResidueNumber();
    logger.debug("String_Node_Str" + resNum + insCode+ "String_Node_Str");
    residueNumber.setChainName(chainId);
    residueNumber.setSeqNum(resNum);
    residueNumber.setInsCode(insCode);
    siteResidues.add(residueNumber);
    logger.debug("String_Node_Str" + residueNumber + "String_Node_Str"+ siteID);
    line=line.substring(11);
  }
  logger.debug("String_Node_Str" + siteToResidueMap.keySet().size() + "String_Node_Str");
  for (  String key : siteToResidueMap.keySet()) {
    logger.debug(key + "String_Node_Str" + siteToResidueMap.get(key));
  }
}