Program: 16506
Project: 16506
Buggy source:
/** 
 * COLUMNS       DATA TYPE          FIELD          DEFINITION ---------------------------------------------------------------- 1 - 6        Record name        "DBREF " 8 - 11       IDcode             idCode         ID code of this entry. 13            Character          chainID        Chain identifier. 15 - 18       Integer            seqBegin       Initial sequence number of the PDB sequence segment. 19            AChar              insertBegin    Initial insertion code of the PDB sequence segment. 21 - 24       Integer            seqEnd         Ending sequence number of the PDB sequence segment. 25            AChar              insertEnd      Ending insertion code of the PDB sequence segment. 27 - 32       LString            database       Sequence database name. 34 - 41       LString            dbAccession    Sequence database accession code. 43 - 54      LString            dbIdCode        Sequence database identification code. 56 - 60      Integer            dbseqBegin      Initial sequence number of the database seqment. 61           AChar              idbnsBeg        Insertion code of initial residue of the segment, if PDB is the reference. 63 - 67      Integer            dbseqEnd        Ending sequence number of the database segment. 68           AChar              dbinsEnd        Insertion code of the ending residue of the segment, if PDB is the reference.
 */
private void pdb_DBREF_Handler(String line){
  logger.debug("String_Node_Str" + line);
  DBRef dbref=new DBRef();
  String idCode=line.substring(7,11);
  String chainId=line.substring(12,13);
  String seqBegin=line.substring(14,18);
  String insertBegin=line.substring(18,19);
  String seqEnd=line.substring(20,24);
  String insertEnd=line.substring(24,25);
  String database=line.substring(26,32);
  String dbAccession=line.substring(33,41);
  String dbIdCode=line.substring(42,54);
  String dbseqBegin=line.substring(55,60);
  String idbnsBeg=line.substring(60,61);
  String dbseqEnd=line.substring(62,67);
  String dbinsEnd=line.substring(67,68);
  dbref.setIdCode(idCode);
  dbref.setChainId(chainId);
  dbref.setSeqBegin(intFromString(seqBegin));
  dbref.setInsertBegin(insertBegin.charAt(0));
  dbref.setSeqEnd(intFromString(seqEnd));
  dbref.setInsertEnd(insertEnd.charAt(0));
  dbref.setDatabase(database.trim());
  dbref.setDbAccession(dbAccession.trim());
  dbref.setDbIdCode(dbIdCode.trim());
  dbref.setDbSeqBegin(intFromString(dbseqBegin));
  dbref.setIdbnsBegin(idbnsBeg.charAt(0));
  dbref.setDbSeqEnd(intFromString(dbseqEnd));
  dbref.setIdbnsEnd(dbinsEnd.charAt(0));
  dbrefs.add(dbref);
}

Fixed version (ground truth):
/** 
 * COLUMNS       DATA TYPE          FIELD          DEFINITION ---------------------------------------------------------------- 1 - 6        Record name        "DBREF " 8 - 11       IDcode             idCode         ID code of this entry. 13            Character          chainID        Chain identifier. 15 - 18       Integer            seqBegin       Initial sequence number of the PDB sequence segment. 19            AChar              insertBegin    Initial insertion code of the PDB sequence segment. 21 - 24       Integer            seqEnd         Ending sequence number of the PDB sequence segment. 25            AChar              insertEnd      Ending insertion code of the PDB sequence segment. 27 - 32       LString            database       Sequence database name. 34 - 41       LString            dbAccession    Sequence database accession code. 43 - 54      LString            dbIdCode        Sequence database identification code. 56 - 60      Integer            dbseqBegin      Initial sequence number of the database seqment. 61           AChar              idbnsBeg        Insertion code of initial residue of the segment, if PDB is the reference. 63 - 67      Integer            dbseqEnd        Ending sequence number of the database segment. 68           AChar              dbinsEnd        Insertion code of the ending residue of the segment, if PDB is the reference.
 */
private void pdb_DBREF_Handler(String line){
  logger.debug("String_Node_Str" + line);
  DBRef dbref=new DBRef();
  String idCode=line.substring(7,11);
  String chainId=line.substring(12,13);
  String seqBegin=line.substring(14,18);
  String insertBegin=line.substring(18,19);
  String seqEnd=line.substring(20,24);
  String insertEnd=line.substring(24,25);
  String database=line.substring(26,32);
  String dbAccession=line.substring(33,41);
  String dbIdCode=line.substring(42,54);
  String dbseqBegin=line.substring(55,60);
  String idbnsBeg=line.substring(60,61);
  String dbseqEnd=line.substring(62,67);
  String dbinsEnd;
  if (line.length() >= 68)   dbinsEnd=line.substring(67,68);
 else   dbinsEnd="String_Node_Str";
  dbref.setIdCode(idCode);
  dbref.setChainId(chainId);
  dbref.setSeqBegin(intFromString(seqBegin));
  dbref.setInsertBegin(insertBegin.charAt(0));
  dbref.setSeqEnd(intFromString(seqEnd));
  dbref.setInsertEnd(insertEnd.charAt(0));
  dbref.setDatabase(database.trim());
  dbref.setDbAccession(dbAccession.trim());
  dbref.setDbIdCode(dbIdCode.trim());
  dbref.setDbSeqBegin(intFromString(dbseqBegin));
  dbref.setIdbnsBegin(idbnsBeg.charAt(0));
  dbref.setDbSeqEnd(intFromString(dbseqEnd));
  dbref.setIdbnsEnd(dbinsEnd.charAt(0));
  dbrefs.add(dbref);
}