Program: 11709
Project: 11709
Buggy source:
final public void run(String args){
  final ArrayList<PointMatch> matches=new ArrayList<PointMatch>();
  if (!setup())   return;
  final ImagePlus target=template.createImagePlus();
  final ImageProcessor ipSource=source.getProcessor();
  final ImageProcessor ipTarget=template.getProcessor().createProcessor(template.getWidth(),template.getHeight());
  final List<Point> sourcePoints=Util.pointRoiToPoints((PointRoi)source.getRoi());
  final List<Point> templatePoints=Util.pointRoiToPoints((PointRoi)template.getRoi());
  final int numMatches=Math.min(sourcePoints.size(),templatePoints.size());
  for (int i=0; i < numMatches; ++i)   matches.add(new PointMatch(sourcePoints.get(i),templatePoints.get(i)));
  final Mapping<?> mapping;
  if (methodIndex == 0) {
    AbstractAffineModel2D<?> model;
switch (modelClassIndex) {
case 0:
      model=new TranslationModel2D();
    break;
case 1:
  model=new RigidModel2D();
break;
case 2:
model=new SimilarityModel2D();
break;
case 3:
model=new AffineModel2D();
break;
default :
return;
}
try {
model.fit(matches);
}
 catch (NotEnoughDataPointsException e) {
IJ.showMessage("String_Node_Str");
return;
}
catch (IllDefinedDataPointsException e) {
IJ.showMessage("String_Node_Str");
return;
}
mapping=new InverseTransformMapping<AbstractAffineModel2D<?>>(model);
}
 else {
final MovingLeastSquaresTransform t=new MovingLeastSquaresTransform();
try {
switch (modelClassIndex) {
case 0:
t.setModel(TranslationModel2D.class);
break;
case 1:
t.setModel(RigidModel2D.class);
break;
case 2:
t.setModel(SimilarityModel2D.class);
break;
case 3:
t.setModel(AffineModel2D.class);
break;
default :
return;
}
}
 catch (Exception e) {
return;
}
t.setAlpha(alpha);
try {
t.setMatches(matches);
mapping=new TransformMeshMapping(new CoordinateTransformMesh(t,meshResolution,source.getWidth(),source.getHeight()));
}
 catch (NotEnoughDataPointsException e) {
IJ.showMessage("String_Node_Str");
return;
}
catch (IllDefinedDataPointsException e) {
IJ.showMessage("String_Node_Str");
return;
}
}
if (interpolate) mapping.mapInterpolated(ipSource,ipTarget);
 else mapping.map(ipSource,ipTarget);
target.setProcessor("String_Node_Str" + source.getTitle(),ipTarget);
target.show();
}

Fixed version (ground truth):
final public void run(String args){
  final ArrayList<PointMatch> matches=new ArrayList<PointMatch>();
  if (!setup())   return;
  final ImagePlus target=template.createImagePlus();
  final ImageProcessor ipSource=source.getProcessor();
  final ImageProcessor ipTarget=source.getProcessor().createProcessor(template.getWidth(),template.getHeight());
  final List<Point> sourcePoints=Util.pointRoiToPoints((PointRoi)source.getRoi());
  final List<Point> templatePoints=Util.pointRoiToPoints((PointRoi)template.getRoi());
  final int numMatches=Math.min(sourcePoints.size(),templatePoints.size());
  for (int i=0; i < numMatches; ++i)   matches.add(new PointMatch(sourcePoints.get(i),templatePoints.get(i)));
  final Mapping<?> mapping;
  if (methodIndex == 0) {
    AbstractAffineModel2D<?> model;
switch (modelClassIndex) {
case 0:
      model=new TranslationModel2D();
    break;
case 1:
  model=new RigidModel2D();
break;
case 2:
model=new SimilarityModel2D();
break;
case 3:
model=new AffineModel2D();
break;
default :
return;
}
try {
model.fit(matches);
}
 catch (NotEnoughDataPointsException e) {
IJ.showMessage("String_Node_Str");
return;
}
catch (IllDefinedDataPointsException e) {
IJ.showMessage("String_Node_Str");
return;
}
mapping=new InverseTransformMapping<AbstractAffineModel2D<?>>(model);
}
 else {
final MovingLeastSquaresTransform t=new MovingLeastSquaresTransform();
try {
switch (modelClassIndex) {
case 0:
t.setModel(TranslationModel2D.class);
break;
case 1:
t.setModel(RigidModel2D.class);
break;
case 2:
t.setModel(SimilarityModel2D.class);
break;
case 3:
t.setModel(AffineModel2D.class);
break;
default :
return;
}
}
 catch (Exception e) {
return;
}
t.setAlpha(alpha);
try {
t.setMatches(matches);
mapping=new TransformMeshMapping(new CoordinateTransformMesh(t,meshResolution,source.getWidth(),source.getHeight()));
}
 catch (NotEnoughDataPointsException e) {
IJ.showMessage("String_Node_Str");
return;
}
catch (IllDefinedDataPointsException e) {
IJ.showMessage("String_Node_Str");
return;
}
}
if (interpolate) mapping.mapInterpolated(ipSource,ipTarget);
 else mapping.map(ipSource,ipTarget);
target.setProcessor("String_Node_Str" + source.getTitle(),ipTarget);
target.show();
}