Buggy code:
public class Composite extends Scrollable { Layout layout ; Control [ ] tabList ; int layoutCount ; int backgroundMode ; Composite ( ) { } public Composite ( Composite parent , int style ) { } Control [ ] _getChildren ( ) { } Control [ ] _getTabList ( ) { } boolean acceptsFirstResponder ( int id , int sel ) { } int accessibilityAttributeNames ( int id , int sel ) { } boolean accessibilityIsIgnored ( int id , int sel ) { } public void changed ( Control [ ] changed ) { } public Point computeSize ( int wHint , int hHint , boolean changed ) { } protected void checkSubclass ( ) { } Control [ ] computeTabList ( ) { } void createHandle ( ) { } void drawBackground ( int id , NSGraphicsContext context , NSRect rect ) { } Composite findDeferredControl ( ) { } Menu [ ] findMenus ( Control control ) { } void fixChildren ( Shell newShell , Shell oldShell , Decorations newDecorations , Decorations oldDecorations , Menu [ ] menus ) { } void fixTabList ( Control control ) { } public int getBackgroundMode ( ) { } public Control [ ] getChildren ( ) { } int getChildrenCount ( ) { } public Layout getLayout ( ) { } public boolean getLayoutDeferred ( ) { } public Control [ ] getTabList ( ) { } boolean hooksKeys ( ) { } void invalidateChildrenVisibleRegion ( ) { } public boolean isLayoutDeferred ( ) { } boolean isOpaque ( int id , int sel ) { } boolean isTabGroup ( ) { } void keyDown ( int id , int sel , int theEvent ) { } 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 ) { } boolean mouseEvent ( int id , int sel , int theEvent , int type ) { } void pageDown ( int id , int sel , int sender ) { } void pageUp ( int id , int sel , int sender ) { } void reflectScrolledClipView ( int id , int sel , int aClipView ) { } void releaseChildren ( boolean destroy ) { } void releaseWidget ( ) { } void removeControl ( Control control ) { } void resized ( ) { } void scrollWheel ( int id , int sel , int theEvent ) { } int nextValidKeyView ( int id , int sel ) { if ( ( view . window ( ) . firstResponder ( ) . id ) == id ) { if ( ( ( state ) & ( CANVAS ) ) != 0 ) { NSEvent event = NSApplication . sharedApplication ( ) . currentEvent ( ) ; <START_BUG> if ( ( event . type ( ) ) == ( OS . NSKeyDown ) ) { <END_BUG> this . keyDown ( id , sel , event . id ) ; return 0 ; } } } return super . nextValidKeyView ( id , sel ) ; } int previousValidKeyView ( int id , int sel ) { } public void setBackgroundMode ( int mode ) { } 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 , NSEvent theEvent ) { } void updateBackgroundMode ( ) { } void updateCursorRects ( boolean enabled ) { } void updateLayout ( boolean all ) { } }

Fix:
if ( ( event != null ) && ( ( event . type ( ) ) == ( OS . NSKeyDown ) ) ) {