Buggy code:
public class Composite extends Scrollable { Layout layout ; Control [ ] tabList ; int scrolledVisibleRgn ; int siblingsVisibleRgn ; int layoutCount ; int backgroundMode ; Composite ( ) { } public Composite ( Composite parent , int style ) { } Control [ ] _getChildren ( ) { } Control [ ] _getTabList ( ) { } int callFocusEventHandler ( int nextHandler , int theEvent ) { } public void changed ( Control [ ] changed ) { } public Point computeSize ( int wHint , int hHint , boolean changed ) { } protected void checkSubclass ( ) { } Control [ ] computeTabList ( ) { } void createHandle ( ) { } void createHandle ( int parentHandle ) { } void createScrolledHandle ( int parentHandle ) { } void drawBackground ( int control , int context ) { } void enableWidget ( boolean enabled ) { } Composite findDeferredControl ( ) { } void fixTabList ( Control control ) { } public int getBackgroundMode ( ) { } public Control [ ] getChildren ( ) { } int getChildrenCount ( ) { } public Layout getLayout ( ) { } public boolean getLayoutDeferred ( ) { } public Control [ ] getTabList ( ) { } int getVisibleRegion ( int control , boolean clipChildren ) { } int kEventControlClick ( int nextHandler , int theEvent , int userData ) { int result = super . kEventControlClick ( nextHandler , theEvent , userData ) ; if ( result == ( OS . noErr ) ) return result ; if ( ( ( state ) & ( CANVAS ) ) != 0 ) { if ( ! ( isEnabled ( ) ) ) return result ; if ( ( ( ( style ) & ( SWT . NO_FOCUS ) ) == 0 ) && ( hooksKeys ( ) ) ) { int [ ] theControl = new int [ 1 ] ; int window = OS . GetControlOwner ( handle ) ; OS . GetKeyboardFocus ( window , theControl ) ; if ( ( handle ) != ( theControl [ 0 ] ) ) { short [ ] count = new short [ 1 ] ; OS . CountSubControls ( handle , count ) ; if ( ( count [ 0 ] ) == 0 ) { <START_BUG> if ( ( OS . SetKeyboardFocus ( window , handle , ( ( short ) ( kControlFocusNextPart ) ) ) ) == ( OS . noErr ) ) { <END_BUG> return OS . noErr ; } } } } } return result ; } int kEventControlGetFocusPart ( int nextHandler , int theEvent , int userData ) { } int kEventControlSetFocusPart ( int nextHandler , int theEvent , int userData ) { } int kEventMouseDown ( int nextHandler , int theEvent , int userData ) { } int kEventRawKeyPressed ( int nextHandler , int theEvent , int userData ) { } int kEventUnicodeKeyPressed ( int nextHandler , int theEvent , int userData ) { } boolean hooksKeys ( ) { } void invalidateChildrenVisibleRegion ( int control ) { } public boolean isLayoutDeferred ( ) { } boolean isTabGroup ( ) { } public void layout ( ) { } public void layout ( boolean changed ) { } public void layout ( boolean changed , boolean all ) { } public void layout ( Control [ ] changed ) { } void markLayout ( boolean changed , boolean all ) { } Point minimumSize ( int wHint , int Hint , boolean changed ) { } void releaseChildren ( boolean destroy ) { } void releaseWidget ( ) { } void removeControl ( Control control ) { } void resetVisibleRegion ( int control ) { } public void setBackgroundMode ( int mode ) { } int setBounds ( int x , int y , int width , int height , boolean move , boolean resize , boolean events ) { } public boolean setFocus ( ) { } public void setLayout ( Layout layout ) { } public void setLayoutDeferred ( boolean defer ) { } boolean setScrollBarVisible ( ScrollBar bar , boolean visible ) { } boolean setTabGroupFocus ( ) { } public void setTabList ( Control [ ] tabList ) { } int traversalCode ( int key , int theEvent ) { } void updateBackgroundMode ( ) { } void updateLayout ( boolean all ) { } }

Fix:
if ( ( OS . SetKeyboardFocus ( window , handle , ( ( short ) ( focusPart ( ) ) ) ) ) == ( OS . noErr ) ) {