Program: 11715
Project: 11715
Buggy source:
public void run(String args){
  if (IJ.versionLessThan("String_Node_Str"))   return;
  int[] ids=WindowManager.getIDList();
  if (ids == null || ids.length < 2) {
    IJ.showMessage("String_Node_Str");
    return;
  }
  String[] titles=new String[ids.length];
  for (int i=0; i < ids.length; ++i) {
    titles[i]=(WindowManager.getImage(ids[i])).getTitle();
  }
  String[] methods=new String[]{"String_Node_Str","String_Node_Str"};
  GenericDialog gd=new GenericDialog("String_Node_Str");
  String current=WindowManager.getCurrentImage().getTitle();
  gd.addChoice("String_Node_Str",titles,current);
  gd.addChoice("String_Node_Str",titles,current.equals(titles[0]) ? titles[1] : titles[0]);
  gd.addMessage("String_Node_Str");
  gd.addNumericField("String_Node_Str",steps,0);
  gd.addNumericField("String_Node_Str",initial_sigma,2);
  gd.addNumericField("String_Node_Str",fdsize,0);
  gd.addNumericField("String_Node_Str",fdbins,0);
  gd.addNumericField("String_Node_Str",min_size,0);
  gd.addNumericField("String_Node_Str",max_size,0);
  gd.addNumericField("String_Node_Str",max_epsilon,2);
  gd.addNumericField("String_Node_Str",min_inlier_ratio,2);
  gd.addCheckbox("String_Node_Str",upscale);
  gd.addChoice("String_Node_Str",methods,methods[1]);
  gd.showDialog();
  if (gd.wasCanceled())   return;
  ImagePlus imp1=WindowManager.getImage(ids[gd.getNextChoiceIndex()]);
  ImagePlus imp2=WindowManager.getImage(ids[gd.getNextChoiceIndex()]);
  steps=(int)gd.getNextNumber();
  initial_sigma=(float)gd.getNextNumber();
  fdsize=(int)gd.getNextNumber();
  fdbins=(int)gd.getNextNumber();
  min_size=(int)gd.getNextNumber();
  max_size=(int)gd.getNextNumber();
  max_epsilon=(float)gd.getNextNumber();
  min_inlier_ratio=(float)gd.getNextNumber();
  upscale=gd.getNextBoolean();
  if (upscale)   scale=2.0f;
 else   scale=1.0f;
  method=gd.getNextChoiceIndex();
  ImageProcessor ip1=imp1.getProcessor().convertToFloat();
  ImageProcessor ip2=imp2.getProcessor().convertToFloat();
  Vector<Feature> fs1;
  Vector<Feature> fs2;
  FloatArray2DSIFT sift=new FloatArray2DSIFT(fdsize,fdbins);
  FloatArray2D fa1=ImageArrayConverter.ImageToFloatArray2D(ip1);
  Filter.enhance(fa1,1.0f);
  FloatArray2D fa2=ImageArrayConverter.ImageToFloatArray2D(ip2);
  Filter.enhance(fa1,1.0f);
  if (upscale) {
    FloatArray2D fat=new FloatArray2D(fa1.width * 2 - 1,fa1.height * 2 - 1);
    FloatArray2DScaleOctave.upsample(fa1,fat);
    fa1=fat;
    fa1=Filter.computeGaussianFastMirror(fa1,(float)Math.sqrt(initial_sigma * initial_sigma - 1.0));
    fat=new FloatArray2D(fa2.width * 2 - 1,fa2.height * 2 - 1);
    FloatArray2DScaleOctave.upsample(fa2,fat);
    fa2=fat;
    fa2=Filter.computeGaussianFastMirror(fa2,(float)Math.sqrt(initial_sigma * initial_sigma - 1.0));
  }
 else {
    fa1=Filter.computeGaussianFastMirror(fa1,(float)Math.sqrt(initial_sigma * initial_sigma - 0.25));
    fa2=Filter.computeGaussianFastMirror(fa2,(float)Math.sqrt(initial_sigma * initial_sigma - 0.25));
  }
  long start_time=System.currentTimeMillis();
  IJ.log("String_Node_Str");
  sift.init(fa1,steps,initial_sigma,min_size,max_size);
  fs1=sift.run(max_size);
  Collections.sort(fs1);
  IJ.log("String_Node_Str" + (System.currentTimeMillis() - start_time) + "String_Node_Str");
  IJ.log(fs1.size() + "String_Node_Str");
  start_time=System.currentTimeMillis();
  IJ.log("String_Node_Str");
  sift.init(fa2,steps,initial_sigma,min_size,max_size);
  fs2=sift.run(max_size);
  Collections.sort(fs2);
  IJ.log("String_Node_Str" + (System.currentTimeMillis() - start_time) + "String_Node_Str");
  IJ.log(fs2.size() + "String_Node_Str");
  start_time=System.currentTimeMillis();
  IJ.log("String_Node_Str");
  Vector<PointMatch> candidates=FloatArray2DSIFT.createMatches(fs1,fs2);
  IJ.log("String_Node_Str" + (System.currentTimeMillis() - start_time) + "String_Node_Str");
  IJ.log(candidates.size() + "String_Node_Str");
  start_time=System.currentTimeMillis();
  IJ.log("String_Node_Str");
  Vector<PointMatch> inliers=new Vector<PointMatch>();
  Model model=null;
  Class<? extends Model> modelClass=null;
switch (method) {
case 0:
    modelClass=TranslationModel2D.class;
  break;
case 1:
modelClass=RigidModel2D.class;
break;
}
IJ.showMessage(modelClass.getCanonicalName());
try {
model=Model.filterRansac(modelClass,candidates,inliers,1000,max_epsilon,min_inlier_ratio);
}
 catch (Exception e) {
System.err.println(e.getMessage());
}
IJ.log("String_Node_Str" + (System.currentTimeMillis() - start_time) + "String_Node_Str");
if (model != null) {
int x1[]=new int[inliers.size()];
int y1[]=new int[inliers.size()];
int x2[]=new int[inliers.size()];
int y2[]=new int[inliers.size()];
int i=0;
for (PointMatch m : inliers) {
float[] m_p1=m.getP1().getL();
float[] m_p2=m.getP2().getL();
x1[i]=(int)(m_p1[0] / scale);
y1[i]=(int)(m_p1[1] / scale);
x2[i]=(int)(m_p2[0] / scale);
y2[i]=(int)(m_p2[1] / scale);
++i;
}
PointRoi pr1=new PointRoi(x1,y1,inliers.size());
PointRoi pr2=new PointRoi(x2,y2,inliers.size());
imp1.setRoi(pr1);
imp2.setRoi(pr2);
IJ.log(inliers.size() + "String_Node_Str" + model.getError()+ "String_Node_Str");
}
 else {
IJ.log("String_Node_Str");
}
}

Fixed version (ground truth):
public void run(String args){
  if (IJ.versionLessThan("String_Node_Str"))   return;
  int[] ids=WindowManager.getIDList();
  if (ids == null || ids.length < 2) {
    IJ.showMessage("String_Node_Str");
    return;
  }
  String[] titles=new String[ids.length];
  for (int i=0; i < ids.length; ++i) {
    titles[i]=(WindowManager.getImage(ids[i])).getTitle();
  }
  String[] methods=new String[]{"String_Node_Str","String_Node_Str"};
  GenericDialog gd=new GenericDialog("String_Node_Str");
  String current=WindowManager.getCurrentImage().getTitle();
  gd.addChoice("String_Node_Str",titles,current);
  gd.addChoice("String_Node_Str",titles,current.equals(titles[0]) ? titles[1] : titles[0]);
  gd.addMessage("String_Node_Str");
  gd.addNumericField("String_Node_Str",steps,0);
  gd.addNumericField("String_Node_Str",initial_sigma,2);
  gd.addNumericField("String_Node_Str",fdsize,0);
  gd.addNumericField("String_Node_Str",fdbins,0);
  gd.addNumericField("String_Node_Str",min_size,0);
  gd.addNumericField("String_Node_Str",max_size,0);
  gd.addNumericField("String_Node_Str",max_epsilon,2);
  gd.addNumericField("String_Node_Str",min_inlier_ratio,2);
  gd.addCheckbox("String_Node_Str",upscale);
  gd.addChoice("String_Node_Str",methods,methods[1]);
  gd.showDialog();
  if (gd.wasCanceled())   return;
  ImagePlus imp1=WindowManager.getImage(ids[gd.getNextChoiceIndex()]);
  ImagePlus imp2=WindowManager.getImage(ids[gd.getNextChoiceIndex()]);
  steps=(int)gd.getNextNumber();
  initial_sigma=(float)gd.getNextNumber();
  fdsize=(int)gd.getNextNumber();
  fdbins=(int)gd.getNextNumber();
  min_size=(int)gd.getNextNumber();
  max_size=(int)gd.getNextNumber();
  max_epsilon=(float)gd.getNextNumber();
  min_inlier_ratio=(float)gd.getNextNumber();
  upscale=gd.getNextBoolean();
  if (upscale)   scale=2.0f;
 else   scale=1.0f;
  method=gd.getNextChoiceIndex();
  ImageProcessor ip1=imp1.getProcessor().convertToFloat();
  ImageProcessor ip2=imp2.getProcessor().convertToFloat();
  Vector<Feature> fs1;
  Vector<Feature> fs2;
  FloatArray2DSIFT sift=new FloatArray2DSIFT(fdsize,fdbins);
  FloatArray2D fa1=ImageArrayConverter.ImageToFloatArray2D(ip1);
  Filter.enhance(fa1,1.0f);
  FloatArray2D fa2=ImageArrayConverter.ImageToFloatArray2D(ip2);
  Filter.enhance(fa2,1.0f);
  float[] initial_kernel;
  if (upscale) {
    FloatArray2D fat=new FloatArray2D(fa1.width * 2 - 1,fa1.height * 2 - 1);
    FloatArray2DScaleOctave.upsample(fa1,fat);
    fa1=fat;
    fat=new FloatArray2D(fa2.width * 2 - 1,fa2.height * 2 - 1);
    FloatArray2DScaleOctave.upsample(fa2,fat);
    fa2=fat;
    initial_kernel=Filter.createGaussianKernel((float)Math.sqrt(initial_sigma * initial_sigma - 1.0),true);
  }
 else   initial_kernel=Filter.createGaussianKernel((float)Math.sqrt(initial_sigma * initial_sigma - 0.25),true);
  fa1=Filter.convolveSeparable(fa1,initial_kernel,initial_kernel);
  fa2=Filter.convolveSeparable(fa2,initial_kernel,initial_kernel);
  long start_time=System.currentTimeMillis();
  IJ.log("String_Node_Str");
  sift.init(fa1,steps,initial_sigma,min_size,max_size);
  fs1=sift.run(max_size);
  Collections.sort(fs1);
  IJ.log("String_Node_Str" + (System.currentTimeMillis() - start_time) + "String_Node_Str");
  IJ.log(fs1.size() + "String_Node_Str");
  start_time=System.currentTimeMillis();
  IJ.log("String_Node_Str");
  sift.init(fa2,steps,initial_sigma,min_size,max_size);
  fs2=sift.run(max_size);
  Collections.sort(fs2);
  IJ.log("String_Node_Str" + (System.currentTimeMillis() - start_time) + "String_Node_Str");
  IJ.log(fs2.size() + "String_Node_Str");
  start_time=System.currentTimeMillis();
  IJ.log("String_Node_Str");
  Vector<PointMatch> candidates=FloatArray2DSIFT.createMatches(fs1,fs2);
  IJ.log("String_Node_Str" + (System.currentTimeMillis() - start_time) + "String_Node_Str");
  IJ.log(candidates.size() + "String_Node_Str");
  start_time=System.currentTimeMillis();
  IJ.log("String_Node_Str");
  Vector<PointMatch> inliers=new Vector<PointMatch>();
  Model model=null;
  Class<? extends Model> modelClass=null;
switch (method) {
case 0:
    modelClass=TranslationModel2D.class;
  break;
case 1:
modelClass=RigidModel2D.class;
break;
}
IJ.showMessage(modelClass.getCanonicalName());
try {
model=Model.filterRansac(modelClass,candidates,inliers,1000,max_epsilon,min_inlier_ratio);
}
 catch (Exception e) {
System.err.println(e.getMessage());
}
IJ.log("String_Node_Str" + (System.currentTimeMillis() - start_time) + "String_Node_Str");
if (model != null) {
int x1[]=new int[inliers.size()];
int y1[]=new int[inliers.size()];
int x2[]=new int[inliers.size()];
int y2[]=new int[inliers.size()];
int i=0;
for (PointMatch m : inliers) {
float[] m_p1=m.getP1().getL();
float[] m_p2=m.getP2().getL();
x1[i]=(int)(m_p1[0] / scale);
y1[i]=(int)(m_p1[1] / scale);
x2[i]=(int)(m_p2[0] / scale);
y2[i]=(int)(m_p2[1] / scale);
++i;
}
PointRoi pr1=new PointRoi(x1,y1,inliers.size());
PointRoi pr2=new PointRoi(x2,y2,inliers.size());
imp1.setRoi(pr1);
imp2.setRoi(pr2);
IJ.log(inliers.size() + "String_Node_Str" + model.getError()+ "String_Node_Str");
}
 else {
IJ.log("String_Node_Str");
}
}