Program: 189829
Project: 189829
Buggy source:
@Override public void paintComponent(Graphics g){
  super.paintComponent(g);
  int width=getWidth();
  int height=getHeight();
  settings.update(width,height);
  Graphics2D g2d=(Graphics2D)g;
  int innerWidth=width - 1;
  int innerHeight=height - settings.tmMarginBottom - 2;
  int innerY=settings.tmMarginTop + 1;
  g2d.setBackground(settings.background.top);
  g2d.setColor(settings.background.top);
  g2d.fillRect(0,innerY,innerWidth,innerHeight);
  if (!this.isEnabled()) {
    return;
  }
  if (model == null) {
    return;
  }
  double min=model.getCustomMin();
  double max=model.getCustomMax();
  double intervalStart=model.getIntervalStart();
  double intervalEnd=model.getIntervalEnd();
  int intervalStartPixel=Math.max(0,getPixelPosition(intervalStart,max - min,min,width));
  int intervalEndPixel=Math.min(width,getPixelPosition(intervalEnd,max - min,min,width));
  g2d.setRenderingHints(settings.renderingHints);
  g2d.drawImage(tickGraph.getImage(model,innerWidth,innerHeight),0,innerY,null);
  if (model.getChart() != null) {
    BufferedImage spImage=sparkline.getImage(model,innerWidth,innerHeight - settings.topChartMargin);
    g2d.drawImage(spImage,0,innerY + settings.topChartMargin,null);
  }
  int vhw=settings.selection.visibleHookWidth;
  int sw=intervalEndPixel - intervalStartPixel;
  if (highlightedComponent != HighlightedComponent.NONE) {
    g2d.setPaint(settings.selection.mouseOverPaint);
switch (highlightedComponent) {
case LEFT_HOOK:
      g2d.fillRect(intervalStartPixel,settings.tmMarginTop,vhw,height - settings.tmMarginBottom - 1);
    g2d.setPaint(settings.selection.paint);
  g2d.fillRect(intervalStartPixel + vhw,settings.tmMarginTop,sw - vhw,height - settings.tmMarginBottom - 1);
break;
case CENTER_HOOK:
g2d.setPaint(settings.selection.paint);
g2d.fillRect(intervalStartPixel,settings.tmMarginTop,vhw,height - settings.tmMarginBottom - 1);
g2d.setPaint(settings.selection.mouseOverPaint);
g2d.fillRect(intervalStartPixel + vhw,settings.tmMarginTop,sw - vhw * 2,height - settings.tmMarginBottom - 1);
g2d.setPaint(settings.selection.paint);
g2d.fillRect(intervalEndPixel - vhw,settings.tmMarginTop,vhw,height - settings.tmMarginBottom - 1);
break;
case RIGHT_HOOK:
g2d.setPaint(settings.selection.paint);
g2d.fillRect(intervalStartPixel,settings.tmMarginTop,sw - vhw,height - settings.tmMarginBottom - 1);
g2d.setPaint(settings.selection.mouseOverPaint);
g2d.fillRect(intervalEndPixel - vhw,settings.tmMarginTop,vhw,height - settings.tmMarginBottom - 1);
break;
}
}
 else {
g2d.setPaint(settings.selection.paint);
g2d.fillRect(intervalStartPixel,settings.tmMarginTop,sw,height - settings.tmMarginBottom - 1);
}
g2d.setColor(settings.defaultStrokeColor);
g2d.drawRect(intervalStartPixel,settings.tmMarginTop,sw - 1,height - settings.tmMarginBottom - 1);
double v=getReal(currentMousePositionX,max - min,min,width);
}

Fixed version (ground truth):
@Override public void paintComponent(Graphics g){
  super.paintComponent(g);
  int width=getWidth();
  int height=getHeight();
  settings.update(width,height);
  Graphics2D g2d=(Graphics2D)g;
  int innerWidth=width - 1;
  int innerHeight=height - settings.tmMarginBottom - 2;
  int innerY=settings.tmMarginTop + 1;
  if (!this.isEnabled()) {
    return;
  }
  if (model == null) {
    return;
  }
  double min=model.getCustomMin();
  double max=model.getCustomMax();
  double intervalStart=model.getIntervalStart();
  double intervalEnd=model.getIntervalEnd();
  int intervalStartPixel=Math.max(0,getPixelPosition(intervalStart,max - min,min,width));
  int intervalEndPixel=Math.min(width,getPixelPosition(intervalEnd,max - min,min,width));
  g2d.setRenderingHints(settings.renderingHints);
  g2d.drawImage(tickGraph.getImage(model,innerWidth,innerHeight),0,innerY,null);
  if (model.getChart() != null) {
    BufferedImage spImage=sparkline.getImage(model,innerWidth,innerHeight - settings.topChartMargin);
    g2d.drawImage(spImage,0,innerY + settings.topChartMargin,null);
  }
  int vhw=settings.selection.visibleHookWidth;
  int sw=intervalEndPixel - intervalStartPixel;
  if (highlightedComponent != HighlightedComponent.NONE) {
    g2d.setPaint(settings.selection.mouseOverPaint);
switch (highlightedComponent) {
case LEFT_HOOK:
      g2d.fillRect(intervalStartPixel,settings.tmMarginTop,vhw,height - settings.tmMarginBottom - 1);
    g2d.setPaint(settings.selection.paint);
  g2d.fillRect(intervalStartPixel + vhw,settings.tmMarginTop,sw - vhw,height - settings.tmMarginBottom - 1);
break;
case CENTER_HOOK:
g2d.setPaint(settings.selection.paint);
g2d.fillRect(intervalStartPixel,settings.tmMarginTop,vhw,height - settings.tmMarginBottom - 1);
g2d.setPaint(settings.selection.mouseOverPaint);
g2d.fillRect(intervalStartPixel + vhw,settings.tmMarginTop,sw - vhw * 2,height - settings.tmMarginBottom - 1);
g2d.setPaint(settings.selection.paint);
g2d.fillRect(intervalEndPixel - vhw,settings.tmMarginTop,vhw,height - settings.tmMarginBottom - 1);
break;
case RIGHT_HOOK:
g2d.setPaint(settings.selection.paint);
g2d.fillRect(intervalStartPixel,settings.tmMarginTop,sw - vhw,height - settings.tmMarginBottom - 1);
g2d.setPaint(settings.selection.mouseOverPaint);
g2d.fillRect(intervalEndPixel - vhw,settings.tmMarginTop,vhw,height - settings.tmMarginBottom - 1);
break;
}
}
 else {
g2d.setPaint(settings.selection.paint);
g2d.fillRect(intervalStartPixel,settings.tmMarginTop,sw,height - settings.tmMarginBottom - 1);
}
g2d.setColor(settings.defaultStrokeColor);
g2d.drawRect(intervalStartPixel,settings.tmMarginTop,sw - 1,height - settings.tmMarginBottom - 1);
double v=getReal(currentMousePositionX,max - min,min,width);
}