Program: 140933
Project: 140933
Buggy source:
/** 
 * Initializes localLightDirectionGrid with interpolated light directions.
 */
public void updateLocalLightDirectionGrid(ProgressIndicator progressIndicator){
  if (localLightAzimuth) {
    if (maxBranchLenghtsGrid == null) {
      updateMaxBranchLengthGrid(progressIndicator);
    }
    GridMinMaxOperator minMaxOp=new GridMinMaxOperator();
    minMaxOp.setProgressIndicator(progressIndicator);
    float[] minMax=minMaxOp.findMinMax(maxBranchLenghtsGrid);
    float threshold=(float)(maxBranchLengthThreshold * (minMax[1] - minMax[0]) + minMax[0]);
    BinaryThresholdOperator thresholder=new BinaryThresholdOperator(threshold);
    thresholder.setProgressIndicator(progressIndicator);
    Grid thresholded=thresholder.operate(maxBranchLenghtsGrid);
    SkeletonizerOperator skeletonizer=new SkeletonizerOperator();
    skeletonizer.setProgressIndicator(progressIndicator);
    Grid skeleton=thresholded;
    do {
      skeletonizer.operate(skeleton,null);
    }
 while (!skeletonizer.isDone());
    MBLBranchPoints tracer=new MBLBranchPoints();
    tracer.setProgressIndicator(progressIndicator);
    GeometryCollection ridgelines=new GeometryCollection();
    tracer.operate(skeleton,ridgelines);
    LightDirectionInterpolationOperator lightOperator=new LightDirectionInterpolationOperator(this,ridgelines);
    lightOperator.setProgressIndicator(progressIndicator);
    localLightDirectionGrid=Grid.shallowCopy(generalizedGrid);
    Grid ignored=localLightDirectionGrid;
    lightOperator.operate(ignored,localLightDirectionGrid);
  }
 else {
    localLightDirectionGrid=null;
  }
}

Fixed version (ground truth):
/** 
 * Initializes localLightDirectionGrid with interpolated light directions.
 */
public void updateLocalLightDirectionGrid(ProgressIndicator progressIndicator){
  if (localLightAzimuth) {
    if (maxBranchLenghtsGrid == null) {
      updateMaxBranchLengthGrid(progressIndicator);
    }
    GridMinMaxOperator minMaxOp=new GridMinMaxOperator();
    minMaxOp.setProgressIndicator(progressIndicator);
    float[] minMax=minMaxOp.findMinMax(maxBranchLenghtsGrid);
    float threshold=(float)(maxBranchLengthThreshold * (minMax[1] - minMax[0]) + minMax[0]);
    BinaryThresholdOperator thresholder=new BinaryThresholdOperator(threshold);
    thresholder.setProgressIndicator(progressIndicator);
    Grid thresholded=thresholder.operate(maxBranchLenghtsGrid);
    SkeletonizerOperator skeletonizer=new SkeletonizerOperator();
    skeletonizer.setProgressIndicator(progressIndicator);
    Grid skeleton=thresholded;
    do {
      skeletonizer.operate(skeleton,null);
    }
 while (!skeletonizer.isDone());
    LinesTracingOperator tracer=new LinesTracingOperator();
    tracer.setProgressIndicator(progressIndicator);
    tracer.operate(skeleton,null);
    GeometryCollection lines=tracer.getLines();
    LightDirectionInterpolationOperator lightOperator=new LightDirectionInterpolationOperator(this,lines);
    lightOperator.setProgressIndicator(progressIndicator);
    localLightDirectionGrid=Grid.shallowCopy(generalizedGrid);
    Grid ignored=localLightDirectionGrid;
    lightOperator.operate(ignored,localLightDirectionGrid);
  }
 else {
    localLightDirectionGrid=null;
  }
}