Program: 70133
Project: 70133
Buggy source:
private void paintSpecial(Graphics g,String text,int x,int y,boolean firstBox,boolean rtl,boolean isMirrored){
  Image image=null;
  GC gc=null;
  if (rtl || isMirrored) {
    TextLayout textLayout=BidiUIUtils.INSTANCE.getTextLayout(SWT.LEFT_TO_RIGHT);
    textLayout.setFont(g.getFont());
    if (firstBox && specialPREFIX.length() != 0 && text.indexOf(specialPREFIX) == 0)     textLayout.setText(text.substring(specialPREFIX.length()));
 else     textLayout.setText(text);
    textLayout.setStyle(new TextStyle(g.getFont(),g.getForegroundColor(),TRANSPARENT_COLOR),0,text.length());
    PaletteData paletteData=new PaletteData(new RGB[]{TRANSPARENT_COLOR.getRGB(),g.getForegroundColor().getRGB()});
    ImageData imageData=new ImageData(textLayout.getBounds().width + 1,textLayout.getBounds().height,4,paletteData);
    imageData.transparentPixel=paletteData.getPixel(TRANSPARENT_COLOR.getRGB());
    image=new Image(Display.getCurrent(),imageData);
    gc=new GC(image,rtl ? SWT.RIGHT_TO_LEFT : SWT.LEFT_TO_RIGHT);
    textLayout.draw(gc,0,0);
  }
  if (firstBox && specialPREFIX.length() != 0 && text.indexOf(specialPREFIX) == 0) {
    int with=FigureUtilities.getTextWidth(specialPREFIX,g.getFont());
    Color c=g.getForegroundColor();
    g.setForegroundColor(ReportColorConstants.greyFillColor);
    g.drawString(specialPREFIX,x,y);
    g.setForegroundColor(c);
    if (image != null)     g.drawImage(image,x + with,y);
 else     g.drawString(text.substring(specialPREFIX.length()),x + with,y);
  }
 else {
    if (image != null)     g.drawImage(image,x,y);
 else     g.drawString(text,x,y);
  }
  if (gc != null)   gc.dispose();
  if (image != null)   image.dispose();
}

Fixed version (ground truth):
private void paintSpecial(Graphics g,String text,int x,int y,boolean firstBox,boolean rtl,boolean isMirrored){
  Image image=null;
  GC gc=null;
  if (rtl || isMirrored) {
    TextLayout textLayout=BidiUIUtils.INSTANCE.getTextLayout(SWT.LEFT_TO_RIGHT);
    textLayout.setFont(g.getFont());
    if (firstBox && specialPREFIX.length() != 0 && text.indexOf(specialPREFIX) == 0)     textLayout.setText(text.substring(specialPREFIX.length()));
 else     textLayout.setText(text);
    textLayout.setStyle(new TextStyle(g.getFont(),g.getForegroundColor(),TRANSPARENT_COLOR),0,text.length());
    RGB rgbData=g.getForegroundColor().getRGB();
    if (ColorConstants.black.getRGB().equals(rgbData)) {
      rgbData=ColorConstants.buttonDarker.getRGB();
    }
    PaletteData paletteData=new PaletteData(new RGB[]{TRANSPARENT_COLOR.getRGB(),rgbData});
    ImageData imageData=new ImageData(textLayout.getBounds().width + 1,textLayout.getBounds().height,4,paletteData);
    imageData.transparentPixel=paletteData.getPixel(TRANSPARENT_COLOR.getRGB());
    image=new Image(Display.getCurrent(),imageData);
    gc=new GC(image,rtl ? SWT.RIGHT_TO_LEFT : SWT.LEFT_TO_RIGHT);
    textLayout.draw(gc,0,0);
  }
  if (firstBox && specialPREFIX.length() != 0 && text.indexOf(specialPREFIX) == 0) {
    int with=FigureUtilities.getTextWidth(specialPREFIX,g.getFont());
    Color c=g.getForegroundColor();
    g.setForegroundColor(ReportColorConstants.greyFillColor);
    g.drawString(specialPREFIX,x,y);
    g.setForegroundColor(c);
    if (image != null)     g.drawImage(image,x + with,y);
 else     g.drawString(text.substring(specialPREFIX.length()),x + with,y);
  }
 else {
    if (image != null)     g.drawImage(image,x,y);
 else     g.drawString(text,x,y);
  }
  if (gc != null)   gc.dispose();
  if (image != null)   image.dispose();
}