Program: 16228
Project: 16228
Buggy source:
/** 
 * Handler for CRYST1 Record Format The CRYST1 record presents the unit cell parameters, space group, and Z value. If the entry describes a structure determined by a technique other than X-ray crystallography, CRYST1 contains a = b = c = 1.0, alpha = beta = gamma = 90 degrees, space group = P 1, and Z =1. <pre> COLUMNS DATA TYPE    FIELD          DEFINITION ------------------------------------------------------------- 1 - 6  Record name  "CRYST1" 7 - 15 Real(9.3)    a              a (Angstroms). 16 - 24 Real(9.3)    b              b (Angstroms). 25 - 33 Real(9.3)    c              c (Angstroms). 34 - 40 Real(7.2)    alpha          alpha (degrees). 41 - 47 Real(7.2)    beta           beta (degrees). 48 - 54 Real(7.2)    gamma          gamma (degrees). 56 - 66 LString      sGroup         Space group. 67 - 70 Integer      z              Z value. </pre>
 */
private void pdb_CRYST1_Handler(String line){
  if (line.length() < 63) {
    logger.warn("String_Node_Str");
    return;
  }
  float a;
  float b;
  float c;
  float alpha;
  float beta;
  float gamma;
  String spaceGroup="String_Node_Str";
  try {
    a=Float.parseFloat(line.substring(6,15).trim());
    b=Float.parseFloat(line.substring(15,24).trim());
    c=Float.parseFloat(line.substring(24,33).trim());
    alpha=Float.parseFloat(line.substring(33,40).trim());
    beta=Float.parseFloat(line.substring(40,47).trim());
    gamma=Float.parseFloat(line.substring(47,54).trim());
  }
 catch (  NumberFormatException e) {
    logger.info("String_Node_Str" + e.getMessage() + "String_Node_Str"+ line);
    return;
  }
  if (line.length() >= 66) {
    spaceGroup=line.substring(55,66).trim();
  }
 else {
    spaceGroup=line.substring(55,line.length()).trim();
  }
  CrystalCell xtalCell=new CrystalCell();
  xtalCell.setA(a);
  xtalCell.setB(b);
  xtalCell.setC(c);
  xtalCell.setAlpha(alpha);
  xtalCell.setBeta(beta);
  xtalCell.setGamma(gamma);
  if (!xtalCell.isCellReasonable()) {
    logger.debug("String_Node_Str",CrystalCell.MIN_VALID_CELL_SIZE);
  }
 else {
    crystallographicInfo.setCrystalCell(xtalCell);
  }
  SpaceGroup sg=SymoplibParser.getSpaceGroup(spaceGroup);
  if (sg == null) {
    logger.warn("String_Node_Str" + spaceGroup + "String_Node_Str");
    crystallographicInfo.setNonStandardSg(true);
  }
 else {
    crystallographicInfo.setSpaceGroup(sg);
    crystallographicInfo.setNonStandardSg(false);
  }
}

Fixed version (ground truth):
/** 
 * Handler for CRYST1 Record Format The CRYST1 record presents the unit cell parameters, space group, and Z value. If the entry describes a structure determined by a technique other than X-ray crystallography, CRYST1 contains a = b = c = 1.0, alpha = beta = gamma = 90 degrees, space group = P 1, and Z =1. <pre> COLUMNS DATA TYPE    FIELD          DEFINITION ------------------------------------------------------------- 1 - 6  Record name  "CRYST1" 7 - 15 Real(9.3)    a              a (Angstroms). 16 - 24 Real(9.3)    b              b (Angstroms). 25 - 33 Real(9.3)    c              c (Angstroms). 34 - 40 Real(7.2)    alpha          alpha (degrees). 41 - 47 Real(7.2)    beta           beta (degrees). 48 - 54 Real(7.2)    gamma          gamma (degrees). 56 - 66 LString      sGroup         Space group. 67 - 70 Integer      z              Z value. </pre>
 */
private void pdb_CRYST1_Handler(String line){
  if (line.length() < 58) {
    logger.warn("String_Node_Str");
    return;
  }
  float a;
  float b;
  float c;
  float alpha;
  float beta;
  float gamma;
  String spaceGroup="String_Node_Str";
  try {
    a=Float.parseFloat(line.substring(6,15).trim());
    b=Float.parseFloat(line.substring(15,24).trim());
    c=Float.parseFloat(line.substring(24,33).trim());
    alpha=Float.parseFloat(line.substring(33,40).trim());
    beta=Float.parseFloat(line.substring(40,47).trim());
    gamma=Float.parseFloat(line.substring(47,54).trim());
  }
 catch (  NumberFormatException e) {
    logger.info("String_Node_Str" + e.getMessage() + "String_Node_Str"+ line);
    return;
  }
  if (line.length() >= 66) {
    spaceGroup=line.substring(55,66).trim();
  }
 else {
    spaceGroup=line.substring(55,line.length()).trim();
  }
  CrystalCell xtalCell=new CrystalCell();
  xtalCell.setA(a);
  xtalCell.setB(b);
  xtalCell.setC(c);
  xtalCell.setAlpha(alpha);
  xtalCell.setBeta(beta);
  xtalCell.setGamma(gamma);
  if (!xtalCell.isCellReasonable()) {
    logger.debug("String_Node_Str",CrystalCell.MIN_VALID_CELL_SIZE);
  }
 else {
    crystallographicInfo.setCrystalCell(xtalCell);
  }
  SpaceGroup sg=SymoplibParser.getSpaceGroup(spaceGroup);
  if (sg == null) {
    logger.warn("String_Node_Str" + spaceGroup + "String_Node_Str");
    crystallographicInfo.setNonStandardSg(true);
  }
 else {
    crystallographicInfo.setSpaceGroup(sg);
    crystallographicInfo.setNonStandardSg(false);
  }
}