Program: 26227
Project: 26227
Buggy source:
/** 
 * Save the transformation.
 * @param intervals number of intervals in the deformation
 * @param cx x- deformation coefficients
 * @param cy y- deformation coefficients
 * @param bIsReverse flat to determine the transformation direction
 */
private void saveTransformation(int intervals,double[][] cx,double[][] cy,boolean bIsReverse){
  String filename=fn_tnf_1;
  if (bIsReverse)   filename=fn_tnf_2;
  if (filename.equals("String_Node_Str")) {
    if (this.dialog.isMacroCall()) {
      if (bIsReverse) {
        int i0=dialog.getMacroArgs().indexOf("String_Node_Str");
        int i1=dialog.getMacroArgs().indexOf("String_Node_Str",i0 + 26);
        filename=i1 == -1 ? dialog.getMacroArgs().substring(i0 + 27) : dialog.getMacroArgs().substring(i0 + 27,i1);
      }
 else {
        int i0=dialog.getMacroArgs().indexOf("String_Node_Str");
        int i1=dialog.getMacroArgs().indexOf("String_Node_Str",i0 + 27);
        filename=i1 == -1 ? dialog.getMacroArgs().substring(i0 + 28) : dialog.getMacroArgs().substring(i0 + 28,i1);
      }
    }
 else {
      File dir=new File("String_Node_Str");
      String path="String_Node_Str";
      try {
        path=dir.getCanonicalPath() + "String_Node_Str";
      }
 catch (      Exception e) {
        e.printStackTrace();
      }
      filename=(bIsReverse) ? targetImp.getTitle() : sourceImp.getTitle();
      String sDirection=(bIsReverse) ? "String_Node_Str" : "String_Node_Str";
      String new_filename="String_Node_Str";
      int dot=filename.lastIndexOf('.');
      if (dot == -1)       new_filename=filename + sDirection + "String_Node_Str";
 else       new_filename=filename.substring(0,dot) + sDirection + "String_Node_Str";
      filename=path + filename;
      if (outputLevel > -1 && this.dialog != null && this.dialog.isMacroCall() == false) {
        final SaveDialog sd=new SaveDialog("String_Node_Str" + sDirection + "String_Node_Str",new_filename,"String_Node_Str");
        path=sd.getDirectory();
        filename=sd.getFileName();
        if ((path == null) || (filename == null))         return;
        filename=path + filename;
      }
 else       filename=new_filename;
    }
  }
  MiscTools.saveElasticTransformation(intervals,cx,cy,filename);
}

Fixed version (ground truth):
/** 
 * Save the transformation.
 * @param intervals number of intervals in the deformation
 * @param cx x- deformation coefficients
 * @param cy y- deformation coefficients
 * @param bIsReverse flat to determine the transformation direction
 */
private void saveTransformation(int intervals,double[][] cx,double[][] cy,boolean bIsReverse){
  String filename=fn_tnf_1;
  if (bIsReverse)   filename=fn_tnf_2;
  if (filename.equals("String_Node_Str")) {
    if (this.dialog.isMacroCall()) {
      if (false == bIsReverse) {
        int i0=dialog.getMacroArgs().indexOf("String_Node_Str");
        int i1=dialog.getMacroArgs().indexOf("String_Node_Str",i0 + 26);
        filename=i1 == -1 ? dialog.getMacroArgs().substring(i0 + 27) : dialog.getMacroArgs().substring(i0 + 27,i1);
      }
 else {
        int i0=dialog.getMacroArgs().indexOf("String_Node_Str");
        int i1=dialog.getMacroArgs().indexOf("String_Node_Str",i0 + 27);
        filename=i1 == -1 ? dialog.getMacroArgs().substring(i0 + 28) : dialog.getMacroArgs().substring(i0 + 28,i1);
      }
    }
 else {
      File dir=new File("String_Node_Str");
      String path="String_Node_Str";
      try {
        path=dir.getCanonicalPath() + "String_Node_Str";
      }
 catch (      Exception e) {
        e.printStackTrace();
      }
      filename=(bIsReverse) ? targetImp.getTitle() : sourceImp.getTitle();
      String sDirection=(bIsReverse) ? "String_Node_Str" : "String_Node_Str";
      String new_filename="String_Node_Str";
      int dot=filename.lastIndexOf('.');
      if (dot == -1)       new_filename=filename + sDirection + "String_Node_Str";
 else       new_filename=filename.substring(0,dot) + sDirection + "String_Node_Str";
      filename=path + filename;
      if (outputLevel > -1 && this.dialog != null && this.dialog.isMacroCall() == false) {
        final SaveDialog sd=new SaveDialog("String_Node_Str" + sDirection + "String_Node_Str",new_filename,"String_Node_Str");
        path=sd.getDirectory();
        filename=sd.getFileName();
        if ((path == null) || (filename == null))         return;
        filename=path + filename;
      }
 else       filename=new_filename;
    }
  }
  MiscTools.saveElasticTransformation(intervals,cx,cy,filename);
}