Program: 151149
Project: 151149
Buggy source:
public static <T extends ImageBase,D extends ImageBase>void doStuff(BufferedImage input,Class<T> imageType,Class<D> derivType){
  T workImage=ConvertBufferedImage.convertFrom(input,null,imageType);
  AnyImageDerivative<T,D> deriv=UtilScaleSpace.createDerivatives(imageType,FactoryImageGenerator.create(derivType));
  deriv.setInput(workImage);
  int r=2;
  GeneralFeatureDetector<T,D> detector=FactoryCornerDetector.createHarris(r,1,NUM_FEATURES,derivType);
  D derivX=null, derivY=null, derivXX=null, derivYY=null, derivXY=null;
  if (detector.getRequiresGradient()) {
    derivX=deriv.getDerivative(true);
    derivY=deriv.getDerivative(false);
  }
 else   if (detector.getRequiresHessian()) {
    derivXX=deriv.getDerivative(true,true);
    derivYY=deriv.getDerivative(false,false);
    derivXY=deriv.getDerivative(true,false);
  }
  detector.process(workImage,derivX,derivY,derivXX,derivYY,derivXY);
  OrientationHistogram<D> orientation=FactoryRegionOrientation.histogram(10,1,false,derivType);
  QueueCorner points=detector.getFeatures();
  FancyInterestPointRender render=new FancyInterestPointRender();
  orientation.setImage(deriv.getDerivative(true),deriv.getDerivative(false));
  for (int i=0; i < points.num; i++) {
    Point2D_I16 p=points.get(i);
    int radius=10;
    orientation.setRadius(radius);
    double angle=orientation.compute(p.x,p.y);
    render.addCircle(p.x,p.y,radius,Color.RED,angle);
  }
  render.draw(input.createGraphics());
  ShowImages.showWindow(input,"String_Node_Str" + imageType.getSimpleName());
}

Fixed version (ground truth):
public static <T extends ImageBase,D extends ImageBase>void doStuff(BufferedImage input,Class<T> imageType,Class<D> derivType){
  T workImage=ConvertBufferedImage.convertFrom(input,null,imageType);
  AnyImageDerivative<T,D> deriv=UtilScaleSpace.createDerivatives(imageType,FactoryImageGenerator.create(derivType));
  deriv.setInput(workImage);
  int r=2;
  GeneralFeatureDetector<T,D> detector=FactoryCornerDetector.createHarris(r,1,NUM_FEATURES,derivType);
  D derivX=null, derivY=null, derivXX=null, derivYY=null, derivXY=null;
  if (detector.getRequiresGradient()) {
    derivX=deriv.getDerivative(true);
    derivY=deriv.getDerivative(false);
  }
 else   if (detector.getRequiresHessian()) {
    derivXX=deriv.getDerivative(true,true);
    derivYY=deriv.getDerivative(false,false);
    derivXY=deriv.getDerivative(true,false);
  }
  detector.process(workImage,derivX,derivY,derivXX,derivYY,derivXY);
  OrientationAverage<D> orientation=FactoryRegionOrientationAlgs.average(1,false,derivType);
  QueueCorner points=detector.getFeatures();
  System.out.println("String_Node_Str" + points.size());
  FancyInterestPointRender render=new FancyInterestPointRender();
  orientation.setImage(deriv.getDerivative(true),deriv.getDerivative(false));
  for (int i=0; i < points.num; i++) {
    Point2D_I16 p=points.get(i);
    int radius=10;
    orientation.setRadius(radius);
    double angle=orientation.compute(p.x,p.y);
    render.addCircle(p.x,p.y,radius,Color.RED,angle);
  }
  render.draw(input.createGraphics());
  ShowImages.showWindow(input,"String_Node_Str" + imageType.getSimpleName());
}