Program: 149552
Project: 149552
Buggy source:
private boolean showDialog(MemoryPeakResults results){
  GenericDialog gd=new GenericDialog(TITLE);
  gd.addHelp(About.HELP_URL);
  Calibration calibration=results.getCalibration();
  gd.addStringField("String_Node_Str",results.getName(),Math.max(Math.min(results.getName().length(),60),20));
  gd.addCheckbox("String_Node_Str",updateAll);
  gd.addNumericField("String_Node_Str",calibration.nmPerPixel,2);
  gd.addNumericField("String_Node_Str",calibration.gain,2);
  gd.addCheckbox("String_Node_Str",calibration.emCCD);
  gd.addNumericField("String_Node_Str",calibration.exposureTime,2);
  gd.addNumericField("String_Node_Str",calibration.bias,2);
  gd.addNumericField("String_Node_Str",calibration.readNoise,2);
  gd.addNumericField("String_Node_Str",calibration.amplification,2);
  gd.showDialog();
  if (gd.wasCanceled())   return false;
  String name=gd.getNextString();
  if (!results.getName().equals(name)) {
    results=MemoryPeakResults.removeResults(results.getName());
    if (results != null) {
      results.setName(name);
      MemoryPeakResults.addResults(results);
    }
  }
  updateAll=gd.getNextBoolean();
  if (!updateAll)   calibration=calibration.clone();
  calibration.nmPerPixel=Math.abs(gd.getNextNumber());
  calibration.gain=Math.abs(gd.getNextNumber());
  calibration.emCCD=gd.getNextBoolean();
  calibration.exposureTime=Math.abs(gd.getNextNumber());
  calibration.bias=Math.abs(gd.getNextNumber());
  calibration.readNoise=Math.abs(gd.getNextNumber());
  calibration.amplification=Math.abs(gd.getNextNumber());
  if (!updateAll)   results.setCalibration(calibration);
  return true;
}

Fixed version (ground truth):
private boolean showDialog(MemoryPeakResults results){
  GenericDialog gd=new GenericDialog(TITLE);
  gd.addHelp(About.HELP_URL);
  Calibration calibration=results.getCalibration();
  boolean newCalibration=false;
  if (calibration == null) {
    newCalibration=true;
    calibration=new Calibration();
    gd.addMessage("String_Node_Str");
  }
  gd.addStringField("String_Node_Str",results.getName(),Math.max(Math.min(results.getName().length(),60),20));
  if (!newCalibration)   gd.addCheckbox("String_Node_Str",updateAll);
  gd.addNumericField("String_Node_Str",calibration.nmPerPixel,2);
  gd.addNumericField("String_Node_Str",calibration.gain,2);
  gd.addCheckbox("String_Node_Str",calibration.emCCD);
  gd.addNumericField("String_Node_Str",calibration.exposureTime,2);
  gd.addNumericField("String_Node_Str",calibration.bias,2);
  gd.addNumericField("String_Node_Str",calibration.readNoise,2);
  gd.addNumericField("String_Node_Str",calibration.amplification,2);
  gd.showDialog();
  if (gd.wasCanceled())   return false;
  String name=gd.getNextString();
  if (!results.getName().equals(name)) {
    results=MemoryPeakResults.removeResults(results.getName());
    if (results != null) {
      results.setName(name);
      MemoryPeakResults.addResults(results);
    }
  }
  if (!newCalibration) {
    updateAll=gd.getNextBoolean();
    if (!updateAll) {
      newCalibration=true;
      calibration=calibration.clone();
    }
  }
  calibration.nmPerPixel=Math.abs(gd.getNextNumber());
  calibration.gain=Math.abs(gd.getNextNumber());
  calibration.emCCD=gd.getNextBoolean();
  calibration.exposureTime=Math.abs(gd.getNextNumber());
  calibration.bias=Math.abs(gd.getNextNumber());
  calibration.readNoise=Math.abs(gd.getNextNumber());
  calibration.amplification=Math.abs(gd.getNextNumber());
  if (newCalibration)   results.setCalibration(calibration);
  return true;
}