Program: 129006
Project: 129006
Buggy source:
/** 
 * This method initialize erase listener to go round the following SWT bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=50163 "Table doesn't respect transparency in column images when using a different row background color" . Unfortunately, use this listener implies that : - automatic tooltip in Table doesn't work anymore - bug when  {@link TableViewer#refresh()} or {@link TableViewer#refresh(boolean)} are called and possibly others...
 */
protected void createEraseItemListener(){
  if (eraseItemListener != null) {
    return;
  }
  eraseItemListener=new Listener(){
    public void handleEvent(    Event event){
      TableItem tableItem=(TableItem)event.item;
      if (table.isDisposed() || tableItem.isDisposed()) {
        return;
      }
      boolean selectedState=(event.detail & SWT.SELECTED) != 0;
      boolean focusedState=table.isFocusControl();
      if (selectedState || event.detail == 22) {
        GC gc=event.gc;
        Rectangle rect=event.getBounds();
        Color previousBackground=gc.getBackground();
        Color previousForeground=gc.getForeground();
        Color bgColor=null;
        Color fgColor=null;
        if (focusedState) {
          if (bgColorSelectedLine != null) {
            bgColor=bgColorSelectedLine;
          }
 else {
            bgColor=table.getDisplay().getSystemColor(SWT.COLOR_LIST_SELECTION);
          }
          if (fgColorSelectedLine != null) {
            fgColor=fgColorSelectedLine;
          }
 else {
            fgColor=table.getDisplay().getSystemColor(SWT.COLOR_BLACK);
          }
        }
 else {
          if (bgColorSelectedLineWhenUnactive != null) {
            bgColor=bgColorSelectedLineWhenUnactive;
          }
 else {
            bgColor=table.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND);
          }
          if (fgColorSelectedLineWhenUnactive != null) {
            fgColor=fgColorSelectedLineWhenUnactive;
          }
 else {
            fgColor=table.getDisplay().getSystemColor(SWT.COLOR_BLACK);
          }
        }
        gc.setBackground(bgColor);
        gc.setForeground(fgColor);
        gc.fillRectangle(rect);
        gc.setBackground(previousBackground);
        gc.setForeground(previousForeground);
        event.detail&=~SWT.SELECTED;
      }
 else       if (event.detail == 24 || event.detail == 28) {
        GC gc=event.gc;
        Rectangle rect=event.getBounds();
        int columnIndex=TableUtils.getColumnIndex(table,new Point(event.x,event.y));
        Color currentBackgroundColumn=tableItem.getBackground(columnIndex);
        Color parentBg=tableItem.getParent().getBackground();
        if (currentBackgroundColumn == parentBg && tableItem.getBackground() != null) {
          currentBackgroundColumn=tableItem.getBackground();
        }
        Color background=gc.getBackground();
        gc.setBackground(currentBackgroundColumn);
        gc.fillRectangle(rect);
        gc.setBackground(background);
      }
    }
  }
;
}

Fixed version (ground truth):
/** 
 * This method initialize erase listener to go round the following SWT bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=50163 "Table doesn't respect transparency in column images when using a different row background color" . Unfortunately, use this listener implies that : - automatic tooltip in Table doesn't work anymore - bug when  {@link TableViewer#refresh()} or {@link TableViewer#refresh(boolean)} are called and possibly others...
 */
protected void createEraseItemListener(){
  if (eraseItemListener != null) {
    return;
  }
  eraseItemListener=new Listener(){
    @Override public void handleEvent(    Event event){
      TableItem tableItem=(TableItem)event.item;
      if (table.isDisposed() || tableItem.isDisposed()) {
        return;
      }
      boolean selectedState=(event.detail & SWT.SELECTED) != 0;
      boolean focusedState=table.isFocusControl();
      if (selectedState || event.detail == 22) {
        GC gc=event.gc;
        Rectangle rect=event.getBounds();
        Color previousBackground=gc.getBackground();
        Color previousForeground=gc.getForeground();
        Color bgColor=null;
        Color fgColor=null;
        if (focusedState) {
          if (bgColorSelectedLine != null) {
            bgColor=bgColorSelectedLine;
          }
 else {
            bgColor=table.getDisplay().getSystemColor(SWT.COLOR_LIST_SELECTION);
          }
          if (fgColorSelectedLine != null) {
            fgColor=fgColorSelectedLine;
          }
 else {
            fgColor=table.getDisplay().getSystemColor(SWT.COLOR_BLACK);
          }
        }
 else {
          if (bgColorSelectedLineWhenUnactive != null) {
            bgColor=bgColorSelectedLineWhenUnactive;
          }
 else {
            bgColor=table.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND);
          }
          if (fgColorSelectedLineWhenUnactive != null) {
            fgColor=fgColorSelectedLineWhenUnactive;
          }
 else {
            fgColor=table.getDisplay().getSystemColor(SWT.COLOR_BLACK);
          }
        }
        gc.setBackground(bgColor);
        gc.setForeground(fgColor);
        gc.fillRectangle(rect);
        gc.setBackground(previousBackground);
        gc.setForeground(previousForeground);
        event.detail&=~SWT.SELECTED;
      }
 else       if (event.detail == 24 || event.detail == 28) {
        GC gc=event.gc;
        Rectangle rect=event.getBounds();
        int columnIndex=TableUtils.getColumnIndex(table,new Point(event.x,event.y));
        Color currentBackgroundColumn=tableItem.getBackground(columnIndex);
        Color parentBg=tableItem.getParent().getBackground();
        if (currentBackgroundColumn == parentBg && tableItem.getBackground() != null) {
          currentBackgroundColumn=tableItem.getBackground();
        }
        Color background=gc.getBackground();
        gc.setBackground(currentBackgroundColumn);
        gc.fillRectangle(rect);
        gc.setBackground(background);
      }
    }
  }
;
}