Program: 17179
Project: 17179
Buggy source:
public void newAtomSite(AtomSite atom){
  boolean startOfNewChain=false;
  String chain_id=atom.getLabel_asym_id();
  String fullname=fixFullAtomName(atom.getLabel_atom_id());
  String recordName=atom.getGroup_PDB();
  String residueNumber=atom.getAuth_seq_id();
  String groupCode3=atom.getLabel_comp_id();
  Character aminoCode1=null;
  if (recordName.equals("String_Node_Str"))   aminoCode1=StructureTools.get1LetterCode(groupCode3);
  String insCode=atom.getPdbx_PDB_ins_code();
  if (!insCode.equals("String_Node_Str")) {
    residueNumber+=insCode;
  }
  long seq_id=-1;
  try {
    seq_id=Long.parseLong(atom.getLabel_seq_id());
  }
 catch (  NumberFormatException e) {
  }
  if (current_chain == null) {
    current_chain=new ChainImpl();
    current_chain.setName(chain_id);
    current_model.add(current_chain);
    startOfNewChain=true;
  }
  if (!chain_id.equals(current_chain.getName())) {
    startOfNewChain=true;
    current_chain.addGroup(current_group);
    Chain testchain;
    testchain=isKnownChain(current_chain.getName(),current_model);
    if (testchain == null) {
      current_model.add(current_chain);
    }
    testchain=isKnownChain(chain_id,current_model);
    if (testchain != null) {
      current_chain=(ChainImpl)testchain;
    }
 else {
      current_chain=new ChainImpl();
      current_chain.setName(chain_id);
    }
  }
  String nmrModel=atom.getPdbx_PDB_model_num();
  if (current_nmr_model == null) {
    current_nmr_model=nmrModel;
  }
  if (!current_nmr_model.equals(nmrModel)) {
    current_nmr_model=nmrModel;
    if (current_chain != null) {
      current_chain.addGroup(current_group);
    }
    structure.setNmr(true);
    structure.addModel(current_model);
    current_model=new ArrayList<Chain>();
    current_chain=null;
    current_group=null;
  }
  if (current_group == null) {
    current_group=getNewGroup(recordName,aminoCode1,seq_id);
    current_group.setPDBCode(residueNumber);
    try {
      current_group.setPDBName(groupCode3);
    }
 catch (    PDBParseException e) {
      System.err.println(e.getMessage());
    }
  }
  if (startOfNewChain) {
    current_group=getNewGroup(recordName,aminoCode1,seq_id);
    current_group.setPDBCode(residueNumber);
    try {
      current_group.setPDBName(groupCode3);
    }
 catch (    PDBParseException e) {
      e.printStackTrace();
    }
  }
  if (!residueNumber.equals(current_group.getPDBCode())) {
    current_chain.addGroup(current_group);
    current_group=getNewGroup(recordName,aminoCode1,seq_id);
    current_group.setPDBCode(residueNumber);
    try {
      current_group.setPDBName(groupCode3);
    }
 catch (    PDBParseException e) {
      e.printStackTrace();
    }
  }
  if (headerOnly)   return;
  atomCount++;
  if (parseCAOnly) {
    if (!fullname.equals("String_Node_Str")) {
      atomCount--;
      return;
    }
  }
  Atom a=convertAtom(atom);
  current_group.addAtom(a);
}

Fixed version (ground truth):
public void newAtomSite(AtomSite atom){
  boolean startOfNewChain=false;
  String chain_id=atom.getLabel_asym_id();
  String fullname=fixFullAtomName(atom.getLabel_atom_id());
  String recordName=atom.getGroup_PDB();
  String residueNumber=atom.getAuth_seq_id();
  String groupCode3=atom.getLabel_comp_id();
  Character aminoCode1=null;
  if (recordName.equals("String_Node_Str"))   aminoCode1=StructureTools.get1LetterCode(groupCode3);
  String insCode=atom.getPdbx_PDB_ins_code();
  if (!insCode.equals("String_Node_Str")) {
    residueNumber+=insCode;
  }
  long seq_id=-1;
  try {
    seq_id=Long.parseLong(atom.getLabel_seq_id());
  }
 catch (  NumberFormatException e) {
  }
  String nmrModel=atom.getPdbx_PDB_model_num();
  if (current_nmr_model == null) {
    current_nmr_model=nmrModel;
  }
  if (!current_nmr_model.equals(nmrModel)) {
    current_nmr_model=nmrModel;
    if (current_chain != null) {
      current_chain.addGroup(current_group);
    }
    structure.setNmr(true);
    structure.addModel(current_model);
    current_model=new ArrayList<Chain>();
    current_chain=null;
    current_group=null;
  }
  if (current_chain == null) {
    current_chain=new ChainImpl();
    current_chain.setName(chain_id);
    current_model.add(current_chain);
    startOfNewChain=true;
  }
  if (!chain_id.equals(current_chain.getName())) {
    startOfNewChain=true;
    current_chain.addGroup(current_group);
    Chain testchain;
    testchain=isKnownChain(current_chain.getName(),current_model);
    if (testchain != null && testchain.getName().equals(chain_id)) {
    }
 else {
      testchain=isKnownChain(chain_id,current_model);
    }
    if (testchain == null) {
      current_chain=new ChainImpl();
      current_chain.setName(chain_id);
    }
 else {
      current_chain=testchain;
    }
    if (!current_model.contains(current_chain))     current_model.add(current_chain);
  }
  if (current_group == null) {
    current_group=getNewGroup(recordName,aminoCode1,seq_id);
    current_group.setPDBCode(residueNumber);
    try {
      current_group.setPDBName(groupCode3);
    }
 catch (    PDBParseException e) {
      System.err.println(e.getMessage());
    }
  }
  if (startOfNewChain) {
    current_group=getNewGroup(recordName,aminoCode1,seq_id);
    current_group.setPDBCode(residueNumber);
    try {
      current_group.setPDBName(groupCode3);
    }
 catch (    PDBParseException e) {
      e.printStackTrace();
    }
  }
  if (!residueNumber.equals(current_group.getPDBCode())) {
    current_chain.addGroup(current_group);
    current_group=getNewGroup(recordName,aminoCode1,seq_id);
    current_group.setPDBCode(residueNumber);
    try {
      current_group.setPDBName(groupCode3);
    }
 catch (    PDBParseException e) {
      e.printStackTrace();
    }
  }
  if (headerOnly)   return;
  atomCount++;
  if (parseCAOnly) {
    if (!fullname.equals("String_Node_Str")) {
      atomCount--;
      return;
    }
  }
  Atom a=convertAtom(atom);
  current_group.addAtom(a);
}