Program: 26216
Project: 26216
Buggy source:
/** 
 * Compare two opposite transformations (direct and inverse) represented by B-splines through the warping index.
 */
private void compareOppositeElasticTransformations(){
  OpenDialog od=new OpenDialog("String_Node_Str","String_Node_Str");
  String path=od.getDirectory();
  String filename=od.getFileName();
  if ((path == null) || (filename == null)) {
    return;
  }
  final String directTransfFilename=path + filename;
  int intervals=MiscTools.numberOfIntervalsOfTransformation(directTransfFilename);
  double[][] cx_direct=new double[intervals + 3][intervals + 3];
  double[][] cy_direct=new double[intervals + 3][intervals + 3];
  MiscTools.loadTransformation(directTransfFilename,cx_direct,cy_direct);
  od=new OpenDialog("String_Node_Str","String_Node_Str");
  path=od.getDirectory();
  filename=od.getFileName();
  if ((path == null) || (filename == null)) {
    return;
  }
  final String inverseTransfFilename=path + filename;
  intervals=MiscTools.numberOfIntervalsOfTransformation(inverseTransfFilename);
  double[][] cx_inverse=new double[intervals + 3][intervals + 3];
  double[][] cy_inverse=new double[intervals + 3][intervals + 3];
  MiscTools.loadTransformation(inverseTransfFilename,cx_inverse,cy_inverse);
  double warpingIndex=MiscTools.warpingIndex(this.sourceImp,this.targetImp,intervals,cx_direct,cy_direct,cx_inverse,cy_inverse);
  if (warpingIndex != -1)   IJ.log("String_Node_Str" + warpingIndex);
 else   IJ.log("String_Node_Str");
  record(IODialog.COMPARE_OPPOSITE_ELASTIC,directTransfFilename,inverseTransfFilename);
}

Fixed version (ground truth):
/** 
 * Compare two opposite transformations (direct and inverse) represented by B-splines through the warping index.
 */
private void compareOppositeElasticTransformations(){
  OpenDialog od=new OpenDialog("String_Node_Str","String_Node_Str");
  String path=od.getDirectory();
  String filename=od.getFileName();
  if ((path == null) || (filename == null)) {
    return;
  }
  final String directTransfFilename=path + filename;
  int intervals=MiscTools.numberOfIntervalsOfTransformation(directTransfFilename);
  double[][] cx_direct=new double[intervals + 3][intervals + 3];
  double[][] cy_direct=new double[intervals + 3][intervals + 3];
  MiscTools.loadTransformation(directTransfFilename,cx_direct,cy_direct);
  od=new OpenDialog("String_Node_Str","String_Node_Str");
  path=od.getDirectory();
  filename=od.getFileName();
  if ((path == null) || (filename == null)) {
    return;
  }
  final String inverseTransfFilename=path + filename;
  intervals=MiscTools.numberOfIntervalsOfTransformation(inverseTransfFilename);
  double[][] cx_inverse=new double[intervals + 3][intervals + 3];
  double[][] cy_inverse=new double[intervals + 3][intervals + 3];
  MiscTools.loadTransformation(inverseTransfFilename,cx_inverse,cy_inverse);
  double warpingIndex=MiscTools.warpingIndex(this.sourceImp,this.targetImp,intervals,cx_direct,cy_direct,cx_inverse,cy_inverse);
  if (warpingIndex != -1)   IJ.log("String_Node_Str" + warpingIndex);
 else   IJ.log("String_Node_Str");
  record(IODialog.COMPARE_OPPOSITE_ELASTIC,directTransfFilename,inverseTransfFilename,targetImp.getTitle(),sourceImp.getTitle());
}