Program: 16873
Project: 16873
Buggy source:
/** 
 * The EntityPolySeq object provide the amino acid sequence objects for the Entities. Later on the entities are mapped to the BioJava Chain and Compound objects.
 * @param epolseq the EntityPolySeq record for one amino acid
 */
public void newEntityPolySeq(EntityPolySeq epolseq){
  logger.debug("String_Node_Str" + epolseq);
  int eId=-1;
  try {
    eId=Integer.parseInt(epolseq.getEntity_id());
  }
 catch (  NumberFormatException e) {
    logger.warn("String_Node_Str" + e.getMessage());
  }
  Entity e=getEntity(eId);
  if (e == null) {
    logger.info("String_Node_Str" + epolseq.getEntity_id() + "String_Node_Str");
    return;
  }
  Chain entityChain=getEntityChain(epolseq.getEntity_id());
  AminoAcid g=new AminoAcidImpl();
  g.setRecordType(AminoAcid.SEQRESRECORD);
  try {
    if (epolseq.getMon_id().length() == 3) {
      g.setPDBName(epolseq.getMon_id());
      Character code1=StructureTools.convert_3code_1code(epolseq.getMon_id());
      g.setAminoType(code1);
      g.setResidueNumber(ResidueNumber.fromString(epolseq.getNum()));
      entityChain.addGroup(g);
    }
 else     if (StructureTools.isNucleotide(epolseq.getMon_id())) {
      NucleotideImpl n=new NucleotideImpl();
      n.setResidueNumber(ResidueNumber.fromString(epolseq.getNum()));
      n.setPDBName(epolseq.getMon_id());
      entityChain.addGroup(n);
    }
 else {
      HetatomImpl h=new HetatomImpl();
      h.setPDBName(epolseq.getMon_id());
      h.setResidueNumber(ResidueNumber.fromString(epolseq.getNum()));
      entityChain.addGroup(h);
    }
  }
 catch (  UnknownPdbAminoAcidException ex) {
    HetatomImpl h=new HetatomImpl();
    h.setPDBName(epolseq.getMon_id());
    h.setResidueNumber(ResidueNumber.fromString(epolseq.getNum()));
    entityChain.addGroup(h);
  }
}

Fixed version (ground truth):
/** 
 * The EntityPolySeq object provide the amino acid sequence objects for the Entities. Later on the entities are mapped to the BioJava Chain and Compound objects.
 * @param epolseq the EntityPolySeq record for one amino acid
 */
public void newEntityPolySeq(EntityPolySeq epolseq){
  logger.debug("String_Node_Str" + epolseq);
  int eId=-1;
  try {
    eId=Integer.parseInt(epolseq.getEntity_id());
  }
 catch (  NumberFormatException e) {
    logger.warn("String_Node_Str" + e.getMessage());
  }
  Entity e=getEntity(eId);
  if (e == null) {
    logger.info("String_Node_Str" + epolseq.getEntity_id() + "String_Node_Str");
    return;
  }
  Chain entityChain=getEntityChain(epolseq.getEntity_id());
  AminoAcid g=new AminoAcidImpl();
  g.setRecordType(AminoAcid.SEQRESRECORD);
  try {
    if (epolseq.getMon_id().length() == 3) {
      g.setPDBName(epolseq.getMon_id());
      Character code1=StructureTools.convert_3code_1code(epolseq.getMon_id());
      g.setAminoType(code1);
      g.setResidueNumber(ResidueNumber.fromString(epolseq.getNum()));
      entityChain.addGroup(g);
    }
 else     if (StructureTools.isNucleotide(epolseq.getMon_id())) {
      NucleotideImpl n=new NucleotideImpl();
      n.setResidueNumber(ResidueNumber.fromString(epolseq.getNum()));
      n.setPDBName(epolseq.getMon_id());
      entityChain.addGroup(n);
    }
 else {
      HetatomImpl h=new HetatomImpl();
      h.setPDBName(epolseq.getMon_id());
      h.setResidueNumber(ResidueNumber.fromString(epolseq.getNum()));
      entityChain.addGroup(h);
    }
  }
 catch (  UnknownPdbAminoAcidException ex) {
    logger.debug("String_Node_Str",epolseq.getNum(),epolseq.getMon_id());
    HetatomImpl h=new HetatomImpl();
    h.setPDBName(epolseq.getMon_id());
    h.setResidueNumber(ResidueNumber.fromString(epolseq.getNum()));
    entityChain.addGroup(h);
  }
}