Buggy code:
public abstract class Control extends Widget implements Drawable { public NSView view ; Composite parent ; String toolTipText ; Object layoutData ; int drawCount ; Menu menu ; Color foreground ; Color background ; Image backgroundImage ; Font font ; Cursor cursor ; Region region ; Accessible accessible ; Control ( ) { } public Control ( Composite parent , int style ) { } boolean acceptsFirstResponder ( ) { } boolean becomeFirstResponder ( ) { } boolean resignFirstResponder ( ) { } public void addControlListener ( ControlListener listener ) { } public void addDragDetectListener ( DragDetectListener listener ) { } public void addFocusListener ( FocusListener listener ) { } public void addHelpListener ( HelpListener listener ) { } public void addKeyListener ( KeyListener listener ) { } public void addMenuDetectListener ( MenuDetectListener listener ) { } public void addMouseListener ( MouseListener listener ) { } public void addMouseTrackListener ( MouseTrackListener listener ) { } public void addMouseMoveListener ( MouseMoveListener listener ) { } public void addMouseWheelListener ( MouseWheelListener listener ) { } public void addPaintListener ( PaintListener listener ) { } public void addTraverseListener ( TraverseListener listener ) { } void checkBackground ( ) { } void checkBuffered ( ) { } public Point computeSize ( int wHint , int hHint ) { } public Point computeSize ( int wHint , int hHint , boolean changed ) { } Control computeTabGroup ( ) { } Control [ ] computeTabList ( ) { } Control computeTabRoot ( ) { } void createWidget ( ) { } Color defaultBackground ( ) { } Font defaultFont ( ) { } Color defaultForeground ( ) { } void destroyWidget ( ) { } public boolean dragDetect ( Event event ) { } public boolean dragDetect ( MouseEvent event ) { } boolean dragDetect ( int button , int count , int stateMask , int x , int y ) { } boolean dragDetect ( int x , int y , boolean filter , boolean [ ] consume ) { } boolean drawGripper ( int x , int y , int width , int height , boolean vertical ) { } void drawRect ( int id , NSRect rect ) { super . drawRect ( id , rect ) ; if ( ( ! ( hooks ( Paint ) ) ) && ( ! ( filters ( Paint ) ) ) ) return ; GCData data = new GCData ( ) ; data . paintRect = rect ; <START_BUG> GC gc = GC . carbon_new ( this , data ) ; <END_BUG> Event event = new Event ( ) ; event . gc = gc ; event . x = ( ( int ) ( rect . x ) ) ; event . y = ( ( int ) ( rect . y ) ) ; event . width = ( ( int ) ( rect . width ) ) ; event . height = ( ( int ) ( rect . height ) ) ; sendEvent ( Paint , event ) ; event . gc = null ; gc . dispose ( ) ; } void enableWidget ( boolean enabled ) { } Cursor findCursor ( ) { } void flagsChanged ( int theEvent ) { } Control findBackgroundControl ( ) { } Menu [ ] findMenus ( Control control ) { } void fixChildren ( Shell newShell , Shell oldShell , Decorations newDecorations , Decorations oldDecorations , Menu [ ] menus ) { } void fixFocus ( Control focusControl ) { } public boolean forceFocus ( ) { } public Accessible getAccessible ( ) { } public Color getBackground ( ) { } Color getBackgroundColor ( ) { } public Image getBackgroundImage ( ) { } public int getBorderWidth ( ) { } public Rectangle getBounds ( ) { } public boolean getDragDetect ( ) { } public Cursor getCursor ( ) { } public boolean getEnabled ( ) { } public Font getFont ( ) { } public Color getForeground ( ) { } Color getForegroundColor ( ) { } public Object getLayoutData ( ) { } public Point getLocation ( ) { } public Menu getMenu ( ) { } int getMininumHeight ( ) { } public Monitor getMonitor ( ) { } public Composite getParent ( ) { } Control [ ] getPath ( ) { } public Region getRegion ( ) { } public Shell getShell ( ) { } public Point getSize ( ) { } public String getToolTipText ( ) { } public boolean getVisible ( ) { } boolean hasBorder ( ) { } boolean hasFocus ( ) { } public int internal_new_GC ( GCData data ) { } public void internal_dispose_GC ( int context , GCData data ) { } public boolean isEnabled ( ) { } boolean isEnabledCursor ( ) { } boolean isFocusAncestor ( Control control ) { } public boolean isFocusControl ( ) { } public boolean isReparentable ( ) { } boolean isShowing ( ) { } boolean isTabGroup ( ) { } boolean isTabItem ( ) { } public boolean isVisible ( ) { } int menuForEvent ( int nsEvent ) { } Decorations menuShell ( ) { } boolean setInputState ( Event event , NSEvent nsEvent , int type ) { } void sendMouseEvent ( NSEvent nsEvent , int type , int button ) { } void mouseDown ( int theEvent ) { } void mouseDragged ( int theEvent ) { } void mouseUp ( int theEvent ) { } boolean sendKeyEvent ( Event event ) { } void sendKeyEvent ( NSEvent nsEvent , int type ) { } void keyDown ( int id , int theEvent ) { } void keyUp ( int id , int theEvent ) { } void markLayout ( boolean changed , boolean all ) { } public void moveAbove ( Control control ) { } public void moveBelow ( Control control ) { } Accessible new_Accessible ( Control control ) { }

Fix:
GC gc = GC . cocoa_new ( this , data ) ;