Program: 16280
Project: 16280
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 {
  loadMaxAtoms=params.getMaxAtoms();
  atomCAThreshold=params.getAtomCaThreshold();
  allModels=new ArrayList<>();
  structure=new StructureImpl();
  currentModel=null;
  currentChain=null;
  currentGroup=null;
  startOfMolecule=true;
  startOfModel=true;
  seqResChains=new ArrayList<Chain>();
  siteMap=new LinkedHashMap<String,Site>();
  pdbHeader=new PDBHeader();
  connects=new ArrayList<Map<String,Integer>>();
  previousContinuationField="String_Node_Str";
  continuationField="String_Node_Str";
  continuationString="String_Node_Str";
  current_compound=null;
  sourceLines.clear();
  compndLines.clear();
  isLastCompndLine=false;
  isLastSourceLine=false;
  prevMolId=-1;
  entities.clear();
  helixList.clear();
  strandList.clear();
  turnList.clear();
  lengthCheck=-1;
  atomCount=0;
  atomOverflow=false;
  siteToResidueMap.clear();
  blankChainIdsPresent=false;
  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")) {
      continue;
    }
    if (line.length() < 6 && !line.startsWith("String_Node_Str")) {
      logger.info("String_Node_Str" + line + "String_Node_Str");
      continue;
    }
    String recordName=null;
    if (line.length() < 6)     recordName=line.trim();
 else     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_TER_Handler();
 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 (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.shouldCreateAtomCharges()) {
    addCharges();
  }
  if (params.isParseSecStruc() && !params.isHeaderOnly())   setSecStruc();
  StructureTools.cleanUpAltLocs(structure);
  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 {
  loadMaxAtoms=params.getMaxAtoms();
  atomCAThreshold=params.getAtomCaThreshold();
  allModels=new ArrayList<>();
  structure=new StructureImpl();
  currentModel=null;
  currentChain=null;
  currentGroup=null;
  startOfMolecule=true;
  startOfModel=true;
  seqResChains=new ArrayList<Chain>();
  siteMap=new LinkedHashMap<String,Site>();
  pdbHeader=new PDBHeader();
  connects=new ArrayList<Map<String,Integer>>();
  previousContinuationField="String_Node_Str";
  continuationField="String_Node_Str";
  continuationString="String_Node_Str";
  current_compound=null;
  sourceLines.clear();
  compndLines.clear();
  isLastCompndLine=false;
  isLastSourceLine=false;
  prevMolId=-1;
  entities.clear();
  helixList.clear();
  strandList.clear();
  turnList.clear();
  lengthCheck=-1;
  atomCount=0;
  atomOverflow=false;
  linkRecords=new ArrayList<LinkRecord>();
  siteToResidueMap.clear();
  blankChainIdsPresent=false;
  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")) {
      continue;
    }
    if (line.length() < 6 && !line.startsWith("String_Node_Str")) {
      logger.info("String_Node_Str" + line + "String_Node_Str");
      continue;
    }
    String recordName=null;
    if (line.length() < 6)     recordName=line.trim();
 else     recordName=line.substring(0,6).trim();
    try {
      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_TER_Handler();
 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);
      }
    }
 catch (    StringIndexOutOfBoundsException|NullPointerException ex) {
      logger.info("String_Node_Str" + line + "String_Node_Str");
    }
  }
  makeCompounds(compndLines,sourceLines);
  triggerEndFileChecks();
  if (params.shouldCreateAtomBonds()) {
    formBonds();
  }
  if (params.shouldCreateAtomCharges()) {
    addCharges();
  }
  if (params.isParseSecStruc() && !params.isHeaderOnly())   setSecStruc();
  StructureTools.cleanUpAltLocs(structure);
  return structure;
}