Buggy code:
int getCaretBlinkTime ( ) { } public Control getCursorControl ( ) { } boolean filterEvent ( Event event ) { } boolean filters ( int eventType ) { } int filterProc ( int xEvent , int gdkEvent , int data ) { } public Point getCursorLocation ( ) { } public Point [ ] getCursorSizes ( ) { } public Object getData ( String key ) { } public Object getData ( ) { } public Point getDPI ( ) { } int gtk_fixed_get_type ( ) { } public static synchronized Display getDefault ( ) { } static boolean isValidClass ( Class clazz ) { } public int getDismissalAlignment ( ) { } public int getDoubleClickTime ( ) { } public Control getFocusControl ( ) { } public boolean getHighContrast ( ) { } public int getDepth ( ) { } public int getIconDepth ( ) { } public Point [ ] getIconSizes ( ) { } int getLastEventTime ( ) { } int getMessageCount ( ) { } public Monitor [ ] getMonitors ( ) { } public Monitor getPrimaryMonitor ( ) { } public Shell [ ] getShells ( ) { } public Thread getSyncThread ( ) { } public Color getSystemColor ( int id ) { } public Cursor getSystemCursor ( int id ) { } public Image getSystemImage ( int id ) { } void initializeSystemResources ( ) { } public Font getSystemFont ( ) { } public Tray getSystemTray ( ) { } public Thread getThread ( ) { } Widget getWidget ( int handle ) { } protected void init ( ) { } void initializeCallbacks ( ) { } void initializeWidgetTable ( ) { } public void internal_dispose_GC ( int gdkGC , GCData data ) { } public int internal_new_GC ( GCData data ) { } boolean isValidThread ( ) { } public Point map ( Control from , Control to , Point point ) { } public Point map ( Control from , Control to , int x , int y ) { } public Rectangle map ( Control from , Control to , Rectangle rectangle ) { } static char mbcsToWcs ( char ch ) { } int menuPositionProc ( int menu , int x , int y , int push_in , int user_data ) { } public Rectangle map ( Control from , Control to , int x , int y , int width , int height ) { } int mouseHoverProc ( int handle ) { } public boolean post ( Event event ) { } void postEvent ( Event event ) { } void putGdkEvents ( ) { } public boolean readAndDispatch ( ) { } synchronized void register ( ) { } protected void release ( ) { } void releaseDisplay ( ) { } public void removeFilter ( int eventType , Listener listener ) { } int removeGdkEvent ( ) { } public void removeListener ( int eventType , Listener listener ) { } void removeMouseHoverTimeout ( int handle ) { } void removePopup ( Menu menu ) { } Widget removeWidget ( int handle ) { } boolean runAsyncMessages ( boolean all ) { } boolean runDeferredEvents ( ) { } boolean runPopups ( ) { } public static void setAppName ( String name ) { } public void setCursorLocation ( int x , int y ) { } public void setCursorLocation ( Point point ) { } public void setData ( String key , Object value ) { checkDevice ( ) ; if ( key == null ) error ( ERROR_NULL_ARGUMENT ) ; if ( key . equals ( Display . ADD_WIDGET_KEY ) ) { Object [ ] data = ( ( Object [ ] ) ( value ) ) ; <START_BUG> int handle = ( ( Integer ) ( data [ 0 ] ) ) . intValue ( ) ; <END_BUG> Widget widget = ( ( Widget ) ( data [ 1 ] ) ) ; if ( widget == null ) removeWidget ( handle ) ; else addWidget ( handle , widget ) ; } if ( key . equals ( Display . DISPATCH_EVENT_KEY ) ) { if ( ( value == null ) || ( value instanceof int [ ] ) ) { dispatchEvents = ( ( int [ ] ) ( value ) ) ; if ( value == null ) putGdkEvents ( ) ; return ; } } if ( value == null ) { if ( ( keys ) == null ) return ; int index = 0 ; while ( ( index < ( keys . length ) ) && ( ! ( keys [ index ] . equals ( key ) ) ) ) index ++ ; if ( index == ( keys . length ) ) return ; if ( ( keys . length ) == 1 ) { keys = null ; values = null ; } else { String [ ] newKeys = new String [ ( keys . length ) - 1 ] ; Object [ ] newValues = new Object [ ( values . length ) - 1 ] ; System . arraycopy ( keys , 0 , newKeys , 0 , index ) ; System . arraycopy ( keys , ( index + 1 ) , newKeys , index , ( ( newKeys . length ) - index ) ) ; System . arraycopy ( values , 0 , newValues , 0 , index ) ; System . arraycopy ( values , ( index + 1 ) , newValues , index , ( ( newValues . length ) - index ) ) ; keys = newKeys ; values = newValues ; } return ; } if ( ( keys ) == null ) { keys = new String [ ] { key } ; values = new Object [ ] { value } ; return ; } for ( int i = 0 ;

Fix:
int handle = ( ( LONG ) ( data [ 0 ] ) ) . value ;