Buggy code:
public class CoolItem extends Item { Control control ; CoolBar parent ; boolean ideal ; int preferredWidth ; int preferredHeight ; int minimumWidth ; int minimumHeight ; int requestedWidth ; Rectangle itemBounds = new Rectangle ( 0 , 0 , 0 , 0 ) ; static final int MARGIN_WIDTH = 4 ; static final int GRABBER_WIDTH = 2 ; static final int MINIMUM_WIDTH = ( 2 * ( CoolItem . MARGIN_WIDTH ) ) + ( CoolItem . GRABBER_WIDTH ) ; private int CHEVRON_HORIZONTAL_TRIM = - 1 ; private int CHEVRON_VERTICAL_TRIM = - 1 ; private static final int CHEVRON_LEFT_MARGIN = 2 ; private static final int CHEVRON_IMAGE_WIDTH = 8 ; ToolBar chevron ; boolean wrap ; Image arrowImage = null ; public CoolItem ( CoolBar parent , int style ) { } public CoolItem ( CoolBar parent , int style , int index ) { } public void addSelectionListener ( SelectionListener listener ) { } protected void checkSubclass ( ) { } void calculateChevronTrim ( ) { } public Point computeSize ( int wHint , int hHint ) { } public void dispose ( ) { } Image createArrowImage ( int width , int height ) { Point point = parent . fixPoint ( width , height ) ; width = point . x ; height = point . y ; Color foreground = parent . getForeground ( ) ; Color black = display . getSystemColor ( COLOR_BLACK ) ; Color background = parent . getBackground ( ) ; PaletteData palette = new PaletteData ( new RGB [ ] { foreground . getRGB ( ) , background . getRGB ( ) , black . getRGB ( ) } ) ; ImageData imageData = new ImageData ( width , height , 4 , palette ) ; imageData . transparentPixel = 1 ; Image image = new Image ( display , imageData ) ; <START_BUG> GC gc = new GC ( image ) ; <END_BUG> gc . setBackground ( background ) ; gc . fillRectangle ( 0 , 0 , width , height ) ; gc . setForeground ( black ) ; int startX = 0 ; if ( ( ( parent . style ) & ( SWT . VERTICAL ) ) != 0 ) { startX = width - ( CoolItem . CHEVRON_IMAGE_WIDTH ) ; } int startY = height // 6 ; int step = 2 ; gc . drawLine ( startX , startY , ( startX + step ) , ( startY + step ) ) ; gc . drawLine ( startX , ( startY + ( 2 * step ) ) , ( startX + step ) , ( startY + step ) ) ; startX ++ ; gc . drawLine ( startX , startY , ( startX + step ) , ( startY + step ) ) ; gc . drawLine ( startX , ( startY + ( 2 * step ) ) , ( startX + step ) , ( startY + step ) ) ; startX += 3 ; gc . drawLine ( startX , startY , ( startX + step ) , ( startY + step ) ) ; gc . drawLine ( startX , ( startY + ( 2 * step ) ) , ( startX + step ) , ( startY + step ) ) ; startX ++ ; gc . drawLine ( startX , startY , ( startX + step ) , ( startY + step ) ) ; gc . drawLine ( startX , ( startY + ( 2 * step ) ) , ( startX + step ) , ( startY + step ) ) ; gc . dispose ( ) ; return image ; } public Rectangle getBounds ( ) { } Rectangle internalGetBounds ( ) { } public Control getControl ( ) { } public Point getMinimumSize ( ) { } public CoolBar getParent ( ) { } public Point getPreferredSize ( ) { } public Point getSize ( ) { } int internalGetMinimumWidth ( ) { } void onSelection ( Event ev ) { } public void removeSelectionListener ( SelectionListener listener ) { } void setBounds ( int x , int y , int width , int height ) { } public void setControl ( Control control ) { } public void setMinimumSize ( int width , int height ) { } public void setMinimumSize ( Point size ) { } public void setPreferredSize ( int width , int height ) { } public void setPreferredSize ( Point size ) { } public void setSize ( int width , int height ) { } public void setSize ( Point size ) { } void updateChevron ( ) { } }

Fix:
GC gc = new GC ( image , ( ( parent . getStyle ( ) ) & ( SWT . RIGHT_TO_LEFT ) ) ) ;