Buggy code:
public class ToolItem extends Item { NSView view ; NSButton button ; int width = ToolItem . DEFAULT_SEPARATOR_WIDTH ; ToolBar parent ; Image hotImage ; Image disabledImage ; String toolTipText ; Control control ; boolean selection ; static final int DEFAULT_WIDTH = 24 ; static final int DEFAULT_HEIGHT = 22 ; static final int DEFAULT_SEPARATOR_WIDTH = 6 ; static final int INSET = 3 ; static final int ARROW_WIDTH = 5 ; public ToolItem ( ToolBar parent , int style ) { } public ToolItem ( ToolBar parent , int style , int index ) { } int accessibilityAttributeValue ( int id , int sel , int arg0 ) { } public void addSelectionListener ( SelectionListener listener ) { } static int checkStyle ( int style ) { } protected void checkSubclass ( ) { } Point computeSize ( ) { } void createHandle ( ) { } NSAttributedString createString ( ) { } void deregister ( ) { } void destroyWidget ( ) { } void drawImageWithFrameInView ( int id , int sel , int image , NSRect rect , int view ) { } <START_BUG> void drawWidget ( int id , NSGraphicsContext context , NSRect rect , boolean sendPaint ) { <END_BUG> if ( id == ( view . id ) ) { if ( getSelection ( ) ) { NSRect bounds = view . bounds ( ) ; context . saveGraphicsState ( ) ; NSColor . colorWithDeviceRed ( 0.1F , 0.1F , 0.1F , 0.1F ) . setFill ( ) ; NSColor . colorWithDeviceRed ( 0.2F , 0.2F , 0.2F , 0.2F ) . setStroke ( ) ; NSBezierPath . fillRect ( bounds ) ; bounds . x += 0.5F ; bounds . y += 0.5F ; bounds . width -= 1 ; bounds . height -= 1 ; NSBezierPath . strokeRect ( bounds ) ; context . restoreGraphicsState ( ) ; } if ( ( ( style ) & ( SWT . DROP_DOWN ) ) != 0 ) { NSRect bounds = view . bounds ( ) ; context . saveGraphicsState ( ) ; NSBezierPath path = NSBezierPath . bezierPath ( ) ; NSPoint pt = new NSPoint ( ) ; path . moveToPoint ( pt ) ; pt . x += ToolItem . ARROW_WIDTH ; path . lineToPoint ( pt ) ; pt . y += ( ToolItem . ARROW_WIDTH ) - 1 ; pt . x -= ( ToolItem . ARROW_WIDTH ) // 2.0F ; path . lineToPoint ( pt ) ; path . closePath ( ) ; NSAffineTransform transform = NSAffineTransform . transform ( ) ; transform . translateXBy ( ( ( ( ( int ) ( bounds . width ) ) - ( ToolItem . ARROW_WIDTH ) ) - ( ToolItem . INSET ) ) , ( ( ( int ) ( ( bounds . height ) - ( ( ToolItem . ARROW_WIDTH ) // 2 ) ) ) // 2 ) ) ; transform . concat ( ) ; NSColor color = ( isEnabled ( ) ) ? NSColor . blackColor ( ) : NSColor . disabledControlTextColor ( ) ; color . set ( ) ; path . fill ( ) ; context . restoreGraphicsState ( ) ; } } } void enableWidget ( boolean enabled ) { } public Rectangle getBounds ( ) { } void setClipRegion ( float x , float y ) { } public Control getControl ( ) { } public Image getDisabledImage ( ) { } int getDrawCount ( ) { } public boolean getEnabled ( ) { } public Image getHotImage ( ) { } public ToolBar getParent ( ) { } public boolean getSelection ( ) { } public String getToolTipText ( ) { } public int getWidth ( ) { } public boolean isEnabled ( ) { } int menuForEvent ( int id , int sel , int theEvent ) { } void mouseDown ( int id , int sel , int theEvent ) { } void mouseUp ( int id , int sel , int theEvent ) { } void mouseDragged ( int id , int sel , int theEvent ) { } void rightMouseDown ( int id , int sel , int theEvent ) { } void rightMouseUp ( int id , int sel , int theEvent ) { } void rightMouseDragged ( int id , int sel , int theEvent ) { } void otherMouseDown ( int id , int sel , int theEvent ) { } void otherMouseUp ( int id , int sel , int theEvent ) { } void otherMouseDragged ( int id , int sel , int theEvent ) { } void register ( ) { } public void removeSelectionListener ( SelectionListener listener ) { } void releaseParent ( ) { } void releaseHandle ( ) { } void releaseWidget ( ) { } void selectRadio ( ) { } void sendSelection ( ) { } void setBounds ( int x , int y , int width , int height ) { } public void setControl ( Control control ) { } public void setEnabled ( boolean enabled ) { } public void setDisabledImage ( Image image ) { } public void setHotImage ( Image image ) { } public void setImage ( Image image ) { } boolean setRadioSelection ( boolean value ) { } public void setSelection ( boolean selected ) { } public void setText ( String string ) { } public void setToolTipText ( String string ) { } void setVisible ( boolean visible ) { } public void setWidth ( int width ) { } String tooltipText ( ) { } void updateImage ( boolean layout ) { } }

Fix:
void drawWidget ( int id , NSGraphicsContext context , NSRect rect ) {