Buggy code:
public abstract class Control extends Widget implements Drawable { int drawCount ; int redrawWindow ; Composite parent ; Cursor cursor ; Menu menu ; Image backgroundImage ; Font font ; String toolTipText ; Object layoutData ; Accessible accessible ; Control ( ) { } public Control ( Composite parent , int style ) { } public void addControlListener ( ControlListener listener ) { } public void addFocusListener ( FocusListener listener ) { } public void addHelpListener ( HelpListener listener ) { } public void addKeyListener ( KeyListener listener ) { } public void addMouseListener ( MouseListener listener ) { } public void addMouseTrackListener ( MouseTrackListener listener ) { } public void addMouseMoveListener ( MouseMoveListener listener ) { } public void addPaintListener ( PaintListener listener ) { } public void addTraverseListener ( TraverseListener listener ) { } int borderHandle ( ) { } void checkBackground ( ) { } void checkBuffered ( ) { } public Point computeSize ( int wHint , int hHint ) { } public Point computeSize ( int wHint , int hHint , boolean changed ) { } Control computeTabGroup ( ) { } Control computeTabRoot ( ) { } Control [ ] computeTabList ( ) { } void createWidget ( int index ) { checkOrientation ( parent ) ; super . createWidget ( index ) ; checkBackground ( ) ; checkBuffered ( ) ; setParentTraversal ( ) ; overrideTranslations ( ) ; if ( ! ( hasIMSupport ( ) ) ) { OS . XmImRegister ( handle , 0 ) ; int focusHandle = focusHandle ( ) ; if ( ( handle ) != focusHandle ) { OS . XmImRegister ( focusHandle , 0 ) ; } } int topHandle = topHandle ( ) ; <START_BUG> if ( OS . XtIsRealized ( topHandle ) ) { <END_BUG> int window = OS . XtWindow ( topHandle ) ; if ( window != 0 ) { int display = OS . XtDisplay ( topHandle ) ; if ( display != 0 ) OS . XLowerWindow ( display , window ) ; } realizeChildren ( ) ; } OS . XtOverrideTranslations ( handle , dragTranslations ) ; font = defaultFont ( ) ; } int defaultBackground ( ) { } Font defaultFont ( ) { } int defaultForeground ( ) { } boolean dragDetect ( int x , int y ) { } boolean dragOverride ( ) { } boolean drawGripper ( int x , int y , int width , int height , boolean vertical ) { } void enableWidget ( boolean enabled ) { } Control findBackgroundControl ( ) { } char findMnemonic ( String string ) { } void fixFocus ( Control focusControl ) { } int focusHandle ( ) { } int fontHandle ( ) { } public boolean forceFocus ( ) { } public Accessible getAccessible ( ) { } public Color getBackground ( ) { } public Image getBackgroundImage ( ) { } int getBackgroundPixel ( ) { } public int getBorderWidth ( ) { } public Rectangle getBounds ( ) { } Point getClientLocation ( ) { } String getCodePage ( ) { } public Cursor getCursor ( ) { } public boolean getEnabled ( ) { } public Font getFont ( ) { } int getFontAscent ( int font ) { } int getFontHeight ( int font ) { } public Color getForeground ( ) { } int getForegroundPixel ( ) { } Caret getIMCaret ( ) { } public Object getLayoutData ( ) { } public Point getLocation ( ) { } public Menu getMenu ( ) { } int getMinimumHeight ( ) { } public Monitor getMonitor ( ) { } int getNavigationType ( ) { } public Composite getParent ( ) { } Control [ ] getPath ( ) { } public Shell getShell ( ) { } public Point getSize ( ) { } public String getToolTipText ( ) { } public boolean getVisible ( ) { } XColor getXColor ( int pixel ) { } boolean hasFocus ( ) { } boolean hasIMSupport ( ) { } void hookEvents ( ) { } int hoverProc ( int id ) { } int hoverProc ( int id , boolean showTip ) { } public int internal_new_GC ( GCData data ) { } public void internal_dispose_GC ( int xGC , GCData data ) { } public boolean isEnabled ( ) { } boolean isFocusAncestor ( Control control ) { } public boolean isFocusControl ( ) { } public boolean isReparentable ( ) { } boolean isShowing ( ) { } boolean isTabGroup ( ) { } boolean isTabItem ( ) { } public boolean isVisible ( ) { } void manageChildren ( ) { } void markLayout ( boolean changed , boolean all ) { } Decorations menuShell ( ) { } boolean mnemonicHit ( char key ) { } boolean mnemonicMatch ( char key ) { } public void moveAbove ( Control control ) { } public void moveBelow ( Control control ) { } void overrideTranslations ( ) { } public void pack ( ) { } public void pack ( boolean changed ) { } void propagateChildren ( boolean enabled ) { } void propagateWidget ( boolean enabled ) { } void realizeChildren ( ) { } public void redraw ( ) { } public void redraw ( int x , int y , int width , int height , boolean all ) { } void redrawChildren ( ) { } void redrawWidget ( int x , int y , int width , int height , boolean redrawAll , boolean allChildren , boolean trim ) { } void releaseHandle ( ) { } void releaseParent ( ) { } void releaseWidget ( ) { } public void removeControlListener ( ControlListener listener ) { } public void removeFocusListener ( FocusListener listener ) { } public void removeHelpListener ( HelpListener listener ) { } public void removeKeyListener ( KeyListener listener ) { }

Fix:
if ( ( OS . XtIsRealized ( topHandle ) ) && ( ! ( OS . XtIsSubclass ( topHandle , OS . shellWidgetClass ( ) ) ) ) ) {