Program: 16803
Project: 16803
Buggy source:
/** 
 * Parse a PDB file and return a datastructure implementing PDBStructure interface.
 * @param buf  a BufferedReader object
 * @return the Structure object
 * @throws IOException ...
 */
public Structure parsePDBFile(BufferedReader buf) throws IOException {
  load_max_atoms=params.getMaxAtoms();
  my_ATOM_CA_THRESHOLD=params.getAtomCaThreshold();
  structure=new StructureImpl();
  current_model=new ArrayList<Chain>();
  seqResChains=new ArrayList<Chain>();
  siteMap=new LinkedHashMap<String,Site>();
  current_chain=null;
  current_group=null;
  pdbHeader=new PDBHeader();
  connects=new ArrayList<Map<String,Integer>>();
  continuationField="String_Node_Str";
  continuationString="String_Node_Str";
  current_compound=new Compound();
  sourceLines.clear();
  compndLines.clear();
  isLastCompndLine=false;
  isLastSourceLine=false;
  molTypeCounter=1;
  compounds.clear();
  helixList.clear();
  strandList.clear();
  turnList.clear();
  lengthCheck=-1;
  atomCount=0;
  atomOverflow=false;
  linkRecords=new ArrayList<LinkRecord>();
  parseCAonly=params.isParseCAOnly();
  String line=null;
  while ((line=buf.readLine()) != null) {
    if (line.equals("String_Node_Str") || (line.equals(NEWLINE))) {
      continue;
    }
    if ((line.startsWith("String_Node_Str")) || (line.startsWith("String_Node_Str"))) {
      continue;
    }
    if (line.length() < 6) {
      logger.info("String_Node_Str" + line + "String_Node_Str");
      continue;
    }
    String recordName=line.substring(0,6).trim();
    if (recordName.equals("String_Node_Str"))     pdb_ATOM_Handler(line);
 else     if (recordName.equals("String_Node_Str"))     pdb_SEQRES_Handler(line);
 else     if (recordName.equals("String_Node_Str"))     pdb_ATOM_Handler(line);
 else     if (recordName.equals("String_Node_Str"))     pdb_MODEL_Handler(line);
 else     if (recordName.equals("String_Node_Str"))     pdb_HEADER_Handler(line);
 else     if (recordName.equals("String_Node_Str"))     pdb_AUTHOR_Handler(line);
 else     if (recordName.equals("String_Node_Str"))     pdb_TITLE_Handler(line);
 else     if (recordName.equals("String_Node_Str"))     sourceLines.add(line);
 else     if (recordName.equals("String_Node_Str"))     compndLines.add(line);
 else     if (recordName.equals("String_Node_Str"))     pdb_JRNL_Handler(line);
 else     if (recordName.equals("String_Node_Str"))     pdb_EXPDTA_Handler(line);
 else     if (recordName.equals("String_Node_Str"))     pdb_CRYST1_Handler(line);
 else     if (recordName.startsWith("String_Node_Str"))     pdb_MTRIXn_Handler(line);
 else     if (recordName.equals("String_Node_Str"))     pdb_REMARK_Handler(line);
 else     if (recordName.equals("String_Node_Str"))     pdb_CONECT_Handler(line);
 else     if (recordName.equals("String_Node_Str"))     pdb_REVDAT_Handler(line);
 else     if (recordName.equals("String_Node_Str"))     pdb_DBREF_Handler(line);
 else     if (recordName.equals("String_Node_Str"))     pdb_SITE_Handler(line);
 else     if (recordName.equals("String_Node_Str"))     pdb_SSBOND_Handler(line);
 else     if (recordName.equals("String_Node_Str"))     pdb_LINK_Handler(line);
 else     if (params.isParseSecStruc()) {
      if (recordName.equals("String_Node_Str"))       pdb_HELIX_Handler(line);
 else       if (recordName.equals("String_Node_Str"))       pdb_SHEET_Handler(line);
 else       if (recordName.equals("String_Node_Str"))       pdb_TURN_Handler(line);
    }
 else {
    }
  }
  makeCompounds(compndLines,sourceLines);
  triggerEndFileChecks();
  if (params.shouldCreateAtomBonds()) {
    formBonds();
  }
  if (params.isParseSecStruc())   setSecStruc();
  return structure;
}

Fixed version (ground truth):
/** 
 * Parse a PDB file and return a datastructure implementing PDBStructure interface.
 * @param buf  a BufferedReader object
 * @return the Structure object
 * @throws IOException ...
 */
public Structure parsePDBFile(BufferedReader buf) throws IOException {
  load_max_atoms=params.getMaxAtoms();
  my_ATOM_CA_THRESHOLD=params.getAtomCaThreshold();
  structure=new StructureImpl();
  current_model=new ArrayList<Chain>();
  seqResChains=new ArrayList<Chain>();
  siteMap=new LinkedHashMap<String,Site>();
  current_chain=null;
  current_group=null;
  pdbHeader=new PDBHeader();
  connects=new ArrayList<Map<String,Integer>>();
  continuationField="String_Node_Str";
  continuationString="String_Node_Str";
  current_compound=new Compound();
  sourceLines.clear();
  compndLines.clear();
  isLastCompndLine=false;
  isLastSourceLine=false;
  molTypeCounter=1;
  compounds.clear();
  helixList.clear();
  strandList.clear();
  turnList.clear();
  lengthCheck=-1;
  atomCount=0;
  atomOverflow=false;
  linkRecords=new ArrayList<LinkRecord>();
  siteToResidueMap.clear();
  parseCAonly=params.isParseCAOnly();
  String line=null;
  while ((line=buf.readLine()) != null) {
    if (line.equals("String_Node_Str") || (line.equals(NEWLINE))) {
      continue;
    }
    if ((line.startsWith("String_Node_Str")) || (line.startsWith("String_Node_Str"))) {
      continue;
    }
    if (line.length() < 6) {
      logger.info("String_Node_Str" + line + "String_Node_Str");
      continue;
    }
    String recordName=line.substring(0,6).trim();
    if (recordName.equals("String_Node_Str"))     pdb_ATOM_Handler(line);
 else     if (recordName.equals("String_Node_Str"))     pdb_SEQRES_Handler(line);
 else     if (recordName.equals("String_Node_Str"))     pdb_ATOM_Handler(line);
 else     if (recordName.equals("String_Node_Str"))     pdb_MODEL_Handler(line);
 else     if (recordName.equals("String_Node_Str"))     pdb_HEADER_Handler(line);
 else     if (recordName.equals("String_Node_Str"))     pdb_AUTHOR_Handler(line);
 else     if (recordName.equals("String_Node_Str"))     pdb_TITLE_Handler(line);
 else     if (recordName.equals("String_Node_Str"))     sourceLines.add(line);
 else     if (recordName.equals("String_Node_Str"))     compndLines.add(line);
 else     if (recordName.equals("String_Node_Str"))     pdb_JRNL_Handler(line);
 else     if (recordName.equals("String_Node_Str"))     pdb_EXPDTA_Handler(line);
 else     if (recordName.equals("String_Node_Str"))     pdb_CRYST1_Handler(line);
 else     if (recordName.startsWith("String_Node_Str"))     pdb_MTRIXn_Handler(line);
 else     if (recordName.equals("String_Node_Str"))     pdb_REMARK_Handler(line);
 else     if (recordName.equals("String_Node_Str"))     pdb_CONECT_Handler(line);
 else     if (recordName.equals("String_Node_Str"))     pdb_REVDAT_Handler(line);
 else     if (recordName.equals("String_Node_Str"))     pdb_DBREF_Handler(line);
 else     if (recordName.equals("String_Node_Str"))     pdb_SITE_Handler(line);
 else     if (recordName.equals("String_Node_Str"))     pdb_SSBOND_Handler(line);
 else     if (recordName.equals("String_Node_Str"))     pdb_LINK_Handler(line);
 else     if (params.isParseSecStruc()) {
      if (recordName.equals("String_Node_Str"))       pdb_HELIX_Handler(line);
 else       if (recordName.equals("String_Node_Str"))       pdb_SHEET_Handler(line);
 else       if (recordName.equals("String_Node_Str"))       pdb_TURN_Handler(line);
    }
 else {
    }
  }
  makeCompounds(compndLines,sourceLines);
  triggerEndFileChecks();
  if (params.shouldCreateAtomBonds()) {
    formBonds();
  }
  if (params.isParseSecStruc())   setSecStruc();
  return structure;
}