Program: 147485
Project: 147485
Buggy source:
/** 
 * Paint the background image
 * @param width
 * @param height
 * @param profile 
 */
private Image paintBackground(int width,int height,KnobColorProfile profile){
  Display display=getDisplay();
  Image background=new Image(display,width,height);
  GC gc=new GC(background);
  gc.setBackground(getBackground());
  gc.fillRectangle(0,0,width,height);
  double min=width;
  double inner=min * 0.4d;
  double outer=min * 0.1d;
  double plateau=min * 0.1d;
  double indicatorWidth=min / 20d;
  double stepping=range.getStepping();
  if (indicatorWidth < 1d)   indicatorWidth=1d;
  double tickWidth=indicatorWidth / 3d;
  if (tickWidth < 1d)   tickWidth=1d;
  int iInner=(int)Math.round(inner) - (int)Math.round(inner) % 2;
  int iOuter=(int)Math.round(outer);
  int iPlateau=(int)Math.round(plateau);
  int iCenterX=iOuter + iInner;
  int iCenterY=iOuter + iInner;
  int iIndicatorWidth=(int)Math.round(indicatorWidth);
  int iTickWidth=(int)Math.round(tickWidth);
  iIndicatorWidth-=1 - iIndicatorWidth % 2;
  iTickWidth-=1 - iTickWidth % 2;
  if (iTickWidth < 1d)   iTickWidth=1;
  if (iIndicatorWidth < 1d)   iIndicatorWidth=1;
  if ((iCenterX + iPlateau) % 2 == 0)   iPlateau++;
  List<Point> ticks11=new ArrayList<Point>();
  Point ap1=getLineCoordinates(iCenterX,iCenterY,iInner + iOuter / 2 + 1,0d);
  Point ap2=getLineCoordinates(iCenterX,iCenterY,iInner + iOuter / 2 + 1,stepping);
  int dX=Math.abs(ap1.x - ap2.x);
  int dY=Math.abs(ap1.y - ap2.y);
  if (1d / stepping <= 72 && (dX > 5 || dY > 5)) {
    for (double v=0d; v <= 1d - stepping; v+=stepping) {
      double tick=range.toNearestInternal(v);
      ticks11.add(getLineCoordinates(iCenterX,iCenterY,iInner + iOuter / 2 + 1,tick));
    }
    double tick=range.toNearestInternal(1d);
    ticks11.add(getLineCoordinates(iCenterX,iCenterY,iInner + iOuter / 2 + 1,tick));
  }
 else {
    ticks11.add(getLineCoordinates(iCenterX,iCenterY,iInner + iOuter / 2 + 1,0d));
    ticks11.add(getLineCoordinates(iCenterX,iCenterY,iInner + iOuter / 2 + 1,0.125d));
    ticks11.add(getLineCoordinates(iCenterX,iCenterY,iInner + iOuter / 2 + 1,0.25d));
    ticks11.add(getLineCoordinates(iCenterX,iCenterY,iInner + iOuter / 2 + 1,0.375d));
    ticks11.add(getLineCoordinates(iCenterX,iCenterY,iInner + iOuter / 2 + 1,0.5d));
    ticks11.add(getLineCoordinates(iCenterX,iCenterY,iInner + iOuter / 2 + 1,0.625d));
    ticks11.add(getLineCoordinates(iCenterX,iCenterY,iInner + iOuter / 2 + 1,0.75d));
    ticks11.add(getLineCoordinates(iCenterX,iCenterY,iInner + iOuter / 2 + 1,0.875d));
    ticks11.add(getLineCoordinates(iCenterX,iCenterY,iInner + iOuter / 2 + 1,1.0d));
  }
  gc.setAdvanced(true);
  gc.setAntialias(SWT.ON);
  gc.setForeground(profile.getTick());
  gc.setBackground(profile.getTick());
  gc.setLineCap(SWT.CAP_FLAT);
  gc.setLineWidth(iTickWidth);
  for (int i=0; i < ticks11.size(); i++) {
    Point p1=ticks11.get(i);
    gc.drawLine(p1.x,p1.y,iCenterX,iCenterY);
  }
  KnobRenderer renderer=new KnobRenderer();
  int transparent=profile.getTransparentByte();
  Color transparentColor=new Color(getDisplay(),transparent,transparent,transparent);
  Image image=renderer.render(getDisplay(),transparentColor,profile,iInner * 2,iInner * 2);
  gc.drawImage(image,0,0,iInner * 2,iInner * 2,iOuter,iOuter,iInner * 2,iInner * 2);
  transparentColor.dispose();
  image.dispose();
  gc.setForeground(profile.getBorder());
  gc.setBackground(profile.getBorder());
  gc.setLineWidth(1);
  gc.drawOval(iOuter,iOuter,iInner * 2,iInner * 2);
  gc.setForeground(profile.getPlateauOuter());
  gc.setBackground(profile.getPlateauOuter());
  gc.fillOval(iCenterX - iPlateau,iCenterY - iPlateau,iPlateau * 2,iPlateau * 2);
  gc.dispose();
  return background;
}

Fixed version (ground truth):
/** 
 * Paint the background image
 * @param width
 * @param height
 * @param profile 
 */
private Image paintBackground(int width,int height,KnobColorProfile profile){
  Display display=getDisplay();
  Image background=new Image(display,width,height);
  GC gc=new GC(background);
  gc.setBackground(getBackground());
  gc.fillRectangle(0,0,width,height);
  double min=width;
  double inner=min * 0.4d;
  double outer=min * 0.1d;
  double plateau=min * 0.1d;
  double indicatorWidth=min / 20d;
  double stepping=range.getStepping();
  if (indicatorWidth < 1d)   indicatorWidth=1d;
  double tickWidth=indicatorWidth / 3d;
  if (tickWidth < 1d)   tickWidth=1d;
  int iInner=(int)Math.round(inner) - (int)Math.round(inner) % 2;
  int iOuter=(int)Math.round(outer);
  int iPlateau=(int)Math.round(plateau);
  int iCenterX=iOuter + iInner;
  int iCenterY=iOuter + iInner;
  int iIndicatorWidth=(int)Math.round(indicatorWidth);
  int iTickWidth=(int)Math.round(tickWidth);
  iIndicatorWidth-=1 - iIndicatorWidth % 2;
  iTickWidth-=1 - iTickWidth % 2;
  if (iTickWidth < 1d)   iTickWidth=1;
  if (iIndicatorWidth < 1d)   iIndicatorWidth=1;
  if ((iCenterX + iPlateau) % 2 == 0)   iPlateau++;
  List<Point> ticks11=new ArrayList<Point>();
  Point ap1=getLineCoordinates(iCenterX,iCenterY,iInner + iOuter / 2 + 1,0d);
  Point ap2=getLineCoordinates(iCenterX,iCenterY,iInner + iOuter / 2 + 1,stepping);
  int dX=Math.abs(ap1.x - ap2.x);
  int dY=Math.abs(ap1.y - ap2.y);
  if (1d / stepping <= 72 && (dX > 5 || dY > 5)) {
    for (double v=0d; v < 1d; v+=stepping) {
      double tick=range.toNearestInternal(v);
      ticks11.add(getLineCoordinates(iCenterX,iCenterY,iInner + iOuter / 2 + 1,tick));
    }
    double tick=range.toNearestInternal(1d);
    ticks11.add(getLineCoordinates(iCenterX,iCenterY,iInner + iOuter / 2 + 1,tick));
  }
 else {
    ticks11.add(getLineCoordinates(iCenterX,iCenterY,iInner + iOuter / 2 + 1,0d));
    ticks11.add(getLineCoordinates(iCenterX,iCenterY,iInner + iOuter / 2 + 1,0.125d));
    ticks11.add(getLineCoordinates(iCenterX,iCenterY,iInner + iOuter / 2 + 1,0.25d));
    ticks11.add(getLineCoordinates(iCenterX,iCenterY,iInner + iOuter / 2 + 1,0.375d));
    ticks11.add(getLineCoordinates(iCenterX,iCenterY,iInner + iOuter / 2 + 1,0.5d));
    ticks11.add(getLineCoordinates(iCenterX,iCenterY,iInner + iOuter / 2 + 1,0.625d));
    ticks11.add(getLineCoordinates(iCenterX,iCenterY,iInner + iOuter / 2 + 1,0.75d));
    ticks11.add(getLineCoordinates(iCenterX,iCenterY,iInner + iOuter / 2 + 1,0.875d));
    ticks11.add(getLineCoordinates(iCenterX,iCenterY,iInner + iOuter / 2 + 1,1.0d));
  }
  gc.setAdvanced(true);
  gc.setAntialias(SWT.ON);
  gc.setForeground(profile.getTick());
  gc.setBackground(profile.getTick());
  gc.setLineCap(SWT.CAP_FLAT);
  gc.setLineWidth(iTickWidth);
  for (int i=0; i < ticks11.size(); i++) {
    Point p1=ticks11.get(i);
    gc.drawLine(p1.x,p1.y,iCenterX,iCenterY);
  }
  KnobRenderer renderer=new KnobRenderer();
  int transparent=profile.getTransparentByte();
  Color transparentColor=new Color(getDisplay(),transparent,transparent,transparent);
  Image image=renderer.render(getDisplay(),transparentColor,profile,iInner * 2,iInner * 2);
  gc.drawImage(image,0,0,iInner * 2,iInner * 2,iOuter,iOuter,iInner * 2,iInner * 2);
  transparentColor.dispose();
  image.dispose();
  gc.setForeground(profile.getBorder());
  gc.setBackground(profile.getBorder());
  gc.setLineWidth(1);
  gc.drawOval(iOuter,iOuter,iInner * 2,iInner * 2);
  gc.setForeground(profile.getPlateauOuter());
  gc.setBackground(profile.getPlateauOuter());
  gc.fillOval(iCenterX - iPlateau,iCenterY - iPlateau,iPlateau * 2,iPlateau * 2);
  gc.dispose();
  return background;
}