Program: 71736
Project: 71736
Buggy source:
public final void paintClientArea(Graphics g){
  if (bPainting) {
    return;
  }
  final Rectangle r=getClientArea().getCopy();
  if (r.width <= 0 || r.height <= 0) {
    return;
  }
  bPainting=true;
  if (bDirty) {
    bDirty=false;
    if (cm == null) {
      bPainting=false;
      logger.log(ILogger.ERROR,Messages.getString("String_Node_Str"));
      return;
    }
    final Display d=Display.getCurrent();
    Dimension dSize=r.getSize();
    if (imgChart == null || imgChart.getImageData().width != dSize.width || imgChart.getImageData().height != dSize.height) {
      if (gc != null) {
        gc.dispose();
      }
      if (imgChart != null) {
        imgChart.dispose();
      }
      bDirty=true;
      final ImageData ida=new ImageData(dSize.width,dSize.height,32,PALETTE_DATA);
      ida.transparentPixel=TRANSPARENT_COLOR;
      imgChart=new Image(d,ida);
      gc=new GC(imgChart);
    }
    final Color clrPreviousBG=gc.getBackground();
    gc.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_LIST_BACKGROUND));
    gc.fillRectangle(0,0,imgChart.getImageData().width,imgChart.getImageData().height);
    gc.setBackground(clrPreviousBG);
    Bounds bo=BoundsImpl.create(0,0,dSize.width,dSize.height);
    bo.scale(72d / idr.getDisplayServer().getDpiResolution());
    idr.setProperty(IDeviceRenderer.GRAPHICS_CONTEXT,gc);
    Generator gr=Generator.instance();
    ChartAdapter.beginIgnoreNotifications();
    cm.clearSections(IConstants.RUN_TIME);
    cm.createSampleRuntimeSeries();
    ChartAdapter.endIgnoreNotifications();
    try {
      RunTimeContext rtc=new RunTimeContext();
      rtc.setScriptingEnabled(false);
      rtc.setMessageLookup(new BIRTDesignerMessageLookup(crii.getHandle()));
      rtc.setRightToLeft(crii.getHandle().isDirectionRTL());
      rtc.setRightToLeftText(DesignChoiceConstants.BIDI_DIRECTION_RTL.equals(crii.getHandle().getPrivateStyle().getTextDirection()));
      rtc.setResourceFinder(crii);
      rtc.setExternalizer(crii);
      boolean bPlotChart=ChartXTabUtil.isPlotChart(crii.getHandle());
      if (bPlotChart) {
        rtc.setScale(createSharedScaleFromSampleData());
      }
      gr.render(idr,gr.build(idr.getDisplayServer(),cm,bo,null,rtc,new ChartReportStyleProcessor(crii.getHandle(),true)));
    }
 catch (    ChartException gex) {
      showException(gc,gex);
    }
  }
  if (imgChart != null) {
    g.drawImage(imgChart,r.x,r.y);
  }
  bPainting=false;
}

Fixed version (ground truth):
public final void paintClientArea(Graphics g){
  if (bPainting) {
    return;
  }
  final Rectangle r=getClientArea().getCopy();
  if (r.width <= 0 || r.height <= 0) {
    return;
  }
  bPainting=true;
  if (bDirty) {
    bDirty=false;
    final Display d=Display.getCurrent();
    Dimension dSize=r.getSize();
    if (imgChart == null || imgChart.getImageData().width != dSize.width || imgChart.getImageData().height != dSize.height) {
      if (gc != null) {
        gc.dispose();
      }
      if (imgChart != null) {
        imgChart.dispose();
      }
      bDirty=true;
      final ImageData ida=new ImageData(dSize.width,dSize.height,32,PALETTE_DATA);
      ida.transparentPixel=TRANSPARENT_COLOR;
      imgChart=new Image(d,ida);
      gc=new GC(imgChart);
    }
    final Color clrPreviousBG=gc.getBackground();
    gc.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_LIST_BACKGROUND));
    gc.fillRectangle(0,0,imgChart.getImageData().width,imgChart.getImageData().height);
    gc.setBackground(clrPreviousBG);
    if (cm == null) {
      showNullChart(dSize);
    }
 else {
      showChart(dSize);
    }
  }
  if (imgChart != null) {
    g.drawImage(imgChart,r.x,r.y);
  }
  bPainting=false;
}