Program: 16809
Project: 16809
Buggy source:
private void triggerEndFileChecks(){
  Date modDate=pdbHeader.getModDate();
  if (modDate.equals(new Date(0))) {
    Date depositionDate=pdbHeader.getDepDate();
    if (!depositionDate.equals(modDate)) {
      pdbHeader.setDepDate(depositionDate);
    }
  }
  if (current_chain != null) {
    current_chain.addGroup(current_group);
    if (isKnownChain(current_chain.getChainID(),current_model) == null) {
      current_model.add(current_chain);
    }
  }
  if (!journalLines.isEmpty()) {
    buildjournalArticle();
    pdbHeader.setJournalArticle(journalArticle);
  }
  structure.addModel(current_model);
  structure.setPDBHeader(pdbHeader);
  structure.setCrystallographicInfo(crystallographicInfo);
  structure.setConnections(connects);
  structure.setDBRefs(dbrefs);
  if (params.isAlignSeqRes()) {
    logger.debug("String_Node_Str");
    SeqRes2AtomAligner aligner=new SeqRes2AtomAligner();
    aligner.align(structure,seqResChains);
  }
 else   if (params.getStoreEmptySeqRes()) {
    logger.debug("String_Node_Str");
    storeUnAlignedSeqRes(structure,seqResChains);
  }
  linkChains2Compound(structure);
  structure.setCompounds(compounds);
  linkSitesToGroups();
  if (bioAssemblyParser != null) {
    pdbHeader.setBioAssemblies(bioAssemblyParser.getTransformationMap());
  }
  if (ncsOperators != null && ncsOperators.size() > 0) {
    crystallographicInfo.setNcsOperators(ncsOperators.toArray(new Matrix4d[ncsOperators.size()]));
  }
  if (rfreeNoCutoffLine > 0 && rfreeStandardLine < 0) {
    pdbHeader.setRfree(rfreeNoCutoffLine);
  }
 else   if (rfreeNoCutoffLine > 0 && rfreeStandardLine > 0) {
    pdbHeader.setRfree(rfreeStandardLine);
  }
 else   if (rfreeNoCutoffLine < 0 && rfreeStandardLine > 0) {
    pdbHeader.setRfree(rfreeStandardLine);
  }
  structure.getCompounds();
}

Fixed version (ground truth):
private void triggerEndFileChecks(){
  Date modDate=pdbHeader.getModDate();
  if (modDate.equals(new Date(0))) {
    Date depositionDate=pdbHeader.getDepDate();
    if (!depositionDate.equals(modDate)) {
      pdbHeader.setDepDate(depositionDate);
    }
  }
  if (current_chain != null) {
    current_chain.addGroup(current_group);
    if (isKnownChain(current_chain.getChainID(),current_model) == null) {
      current_model.add(current_chain);
    }
  }
  if (!journalLines.isEmpty()) {
    buildjournalArticle();
    pdbHeader.setJournalArticle(journalArticle);
  }
  Iterator<Chain> it=current_model.iterator();
  while (it.hasNext()) {
    Chain c=it.next();
    if (StructureTools.isChainWaterOnly(c)) {
      logger.warn("String_Node_Str",c.getChainID(),c.getAtomGroups().size());
      it.remove();
    }
  }
  structure.addModel(current_model);
  structure.setPDBHeader(pdbHeader);
  structure.setCrystallographicInfo(crystallographicInfo);
  structure.setConnections(connects);
  structure.setDBRefs(dbrefs);
  if (params.isAlignSeqRes()) {
    logger.debug("String_Node_Str");
    SeqRes2AtomAligner aligner=new SeqRes2AtomAligner();
    aligner.align(structure,seqResChains);
  }
 else   if (params.getStoreEmptySeqRes()) {
    logger.debug("String_Node_Str");
    storeUnAlignedSeqRes(structure,seqResChains);
  }
  linkChains2Compound(structure);
  structure.setCompounds(compounds);
  linkSitesToGroups();
  if (bioAssemblyParser != null) {
    pdbHeader.setBioAssemblies(bioAssemblyParser.getTransformationMap());
  }
  if (ncsOperators != null && ncsOperators.size() > 0) {
    crystallographicInfo.setNcsOperators(ncsOperators.toArray(new Matrix4d[ncsOperators.size()]));
  }
  if (rfreeNoCutoffLine > 0 && rfreeStandardLine < 0) {
    pdbHeader.setRfree(rfreeNoCutoffLine);
  }
 else   if (rfreeNoCutoffLine > 0 && rfreeStandardLine > 0) {
    pdbHeader.setRfree(rfreeStandardLine);
  }
 else   if (rfreeNoCutoffLine < 0 && rfreeStandardLine > 0) {
    pdbHeader.setRfree(rfreeStandardLine);
  }
  structure.getCompounds();
}