Buggy code:
public Point computeSize ( int wHint , int hHint ) { } public Point computeSize ( int wHint , int hHint , boolean changed ) { } Widget computeTabGroup ( ) { } Widget [ ] computeTabList ( ) { } Control computeTabRoot ( ) { } NSView contentView ( ) { } NSAttributedString createString ( String string , Font font , float [ ] foreground , int alignment , boolean wrap , boolean enabled , boolean mnemonics ) { } void createWidget ( ) { } Color defaultBackground ( ) { } Font defaultFont ( ) { } Color defaultForeground ( ) { } NSFont defaultNSFont ( ) { } void deregister ( ) { } void destroyWidget ( ) { } void doCommandBySelector ( int id , int sel , int selector ) { } 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 drawWidget ( int id , NSGraphicsContext context , NSRect rect ) { } void enableWidget ( boolean enabled ) { } boolean equals ( float [ ] color1 , float [ ] color2 ) { } NSView eventView ( ) { } void fillBackground ( NSView view , NSGraphicsContext context , NSRect rect , int imgHeight ) { } Cursor findCursor ( ) { } Control findBackgroundControl ( ) { } Menu [ ] findMenus ( Control control ) { } Widget findTooltip ( NSPoint pt ) { } void fixChildren ( Shell newShell , Shell oldShell , Decorations newDecorations , Decorations oldDecorations , Menu [ ] menus ) { } void fixFocus ( Control focusControl ) { } void flagsChanged ( int id , int sel , int theEvent ) { } NSView focusView ( ) { } public boolean forceFocus ( ) { } public Accessible getAccessible ( ) { } public Color getBackground ( ) { } Color getBackgroundColor ( ) { } public Image getBackgroundImage ( ) { } public int getBorderWidth ( ) { } public Rectangle getBounds ( ) { } public boolean getDragDetect ( ) { } boolean getDrawing ( ) { } 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 ( ) { } NSBezierPath getPath ( Region region ) { } NSBezierPath getPath ( int region ) { } public Region getRegion ( ) { } public Shell getShell ( ) { } public Point getSize ( ) { } float getThemeAlpha ( ) { } public String getToolTipText ( ) { } public boolean getVisible ( ) { } int getVisibleRegion ( ) { } boolean hasBorder ( ) { } boolean hasFocus ( ) { } int hitTest ( int id , int sel , NSPoint point ) { } boolean imeInComposition ( ) { } boolean insertText ( int id , int sel , int string ) { if ( ( view . window ( ) . firstResponder ( ) . id ) == id ) { Shell s = this . getShell ( ) ; NSEvent nsEvent = NSApplication . sharedApplication ( ) . currentEvent ( ) ; if ( nsEvent != null ) { int type = nsEvent . type ( ) ; if ( ( ( ! ( s . keyInputHappened ) ) && ( type == ( OS . NSKeyDown ) ) ) || ( type == ( OS . NSSystemDefined ) ) ) { NSString str = new NSString ( string ) ; <START_BUG> if ( str . isKindOfClass ( OS . objc_getClass ( "NSAttributedString" ) ) ) { <END_BUG> str = new NSAttributedString ( string ) . string ( ) ; } int length = ( ( int ) ( str . length ( ) ) ) ; char [ ] buffer = new char [ length ] ; str . getCharacters ( buffer ) ; for ( int i = 0 ; i < ( buffer . length ) ; i ++ ) { s . keyInputHappened = true ; Event event = new Event ( ) ; if ( ( i == 0 ) && ( type == ( OS . NSKeyDown ) ) ) setKeyState ( event , KeyDown , nsEvent ) ; event . character = buffer [ i ] ; if ( ! ( sendKeyEvent ( KeyDown , event ) ) ) return false ; } } } if ( ( ( state ) & ( CANVAS ) ) != 0 ) return true ; } return super . insertText ( id , sel , string ) ; } public int internal_new_GC ( GCData data ) { } public void internal_dispose_GC ( int context , GCData data ) { } void invalidateChildrenVisibleRegion ( ) { } void invalidateVisibleRegion ( ) { } boolean isActive ( ) { } boolean isDescribedByLabel ( ) { } boolean isDrawing ( ) { } public boolean isEnabled ( ) { } boolean isEnabledCursor ( ) { } boolean isFocusAncestor ( Control control ) { } public boolean isFocusControl ( ) { } boolean isObscured ( ) { } public boolean isReparentable ( ) { } boolean isShowing ( ) { } boolean isTabGroup ( ) { } boolean isTabItem ( ) { }

Fix:
if ( str . isKindOfClass ( class_NSAttributedString ) ) {