Buggy code:
public Image getSystemImage ( int id ) { } public Tray getSystemTray ( ) { } public Thread getThread ( ) { } int getToolTipTime ( ) { } Widget getWidget ( int id ) { } Widget getWidget ( NSView view ) { } protected void init ( ) { } void initApplicationDelegate ( ) { } void addEventMethods ( int cls , int proc2 , int proc3 , int drawRectProc ) { } void addFrameMethods ( int cls , int setFrameOriginProc , int setFrameSizeProc ) { } void initClasses ( ) { } public int internal_new_GC ( GCData data ) { } public void internal_dispose_GC ( int context , GCData data ) { } static boolean isValidClass ( Class clazz ) { } boolean isValidThread ( ) { } public boolean post ( Event event ) { } void postEvent ( Event event ) { } 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 ) { } public Rectangle map ( Control from , Control to , int x , int y , int width , int height ) { } public boolean readAndDispatch ( ) { } static void register ( Display display ) { } protected void release ( ) { } void releaseDisplay ( ) { } void removeContext ( NSGraphicsContext context ) { } public void removeFilter ( int eventType , Listener listener ) { } public void removeListener ( int eventType , Listener listener ) { } Widget removeWidget ( NSObject view ) { } void removeMenu ( Menu menu ) { } void removePopup ( Menu menu ) { } boolean runAsyncMessages ( boolean all ) { } boolean runContexts ( ) { } boolean runDeferredEvents ( ) { } boolean runPopups ( ) { } boolean runTimers ( ) { } void sendEvent ( int eventType , Event event ) { } public static void setAppName ( String name ) { } Runnable hoverTimer = new Runnable ( ) { public void run ( ) { } } ; Runnable caretTimer = new Runnable ( ) { public void run ( ) { } } ; void setCurrentCaret ( Caret caret ) { } void setCursor ( Control control ) { } public void setCursorLocation ( int x , int y ) { } public void setCursorLocation ( Point point ) { } public void setData ( String key , Object value ) { } void setMenuBar ( Menu menu ) { } public void setData ( Object data ) { } public void setSynchronizer ( Synchronizer synchronizer ) { } public boolean sleep ( ) { } int sourceProc ( int info ) { } public void syncExec ( Runnable runnable ) { } public void timerExec ( int milliseconds , Runnable runnable ) { } int timerProc ( int id , int sel , int timerID ) { } public void update ( ) { } public void wake ( ) { } void wakeThread ( ) { } Control findControl ( NSEvent nsEvent , boolean checkGrab , boolean checkTrim , boolean checkWindows ) { } int applicationNextEventMatchingMask ( int id , int sel , int mask , int expiration , int mode , int dequeue ) { } void applicationSendMouseEvent ( NSEvent nsEvent , boolean send ) { if ( send ) runDeferredEvents ( ) ; boolean up = false ; int type = ( ( int ) ( nsEvent . type ( ) ) ) ; switch ( type ) { case OS . NSLeftMouseDown : case OS . NSRightMouseDown : case OS . NSOtherMouseDown : { Control control = grabControl = findControl ( nsEvent , false , true , false ) ; if ( control != null ) { <START_BUG> if ( ( ( ( type == ( OS . NSLeftMouseDown ) ) && ( ( nsEvent . clickCount ( ) ) == 1 ) ) && ( ( ( control . state ) & ( Widget . DRAG_DETECT ) ) != 0 ) ) && ( control . hooks ( DragDetect ) ) ) { <END_BUG> dragging = true ; } control . sendMouseEvent ( nsEvent , MouseDown , send ) ; if ( ( nsEvent . clickCount ( ) ) == 2 ) { control . sendMouseEvent ( nsEvent , MouseDoubleClick , send ) ; } } break ; } case OS . NSLeftMouseUp : case OS . NSRightMouseUp : case OS . NSOtherMouseUp : { Control control = findControl ( nsEvent , true , true , false ) ; if ( control != null ) { control . sendMouseEvent ( nsEvent , MouseUp , send ) ; } grabControl = null ; up = true ; } case OS . NSLeftMouseDragged : case OS . NSRightMouseDragged : case OS . NSOtherMouseDragged : case OS . NSMouseMoved : { Control control = findControl ( nsEvent , true , true , ( type == ( OS . NSMouseMoved ) ) ) ; if ( dragging ) { dragging = false ; control . sendDragEvent ( nsEvent ) ; } if ( control != ( currentControl ) ) { if ( ( currentControl ) != null ) { currentControl . sendMouseEvent ( nsEvent , MouseExit , send ) ; } currentControl = control ; if ( control != null ) { control . sendMouseEvent ( nsEvent , MouseEnter , send ) ; if ( up ) timerExec ( getToolTipTime ( ) , hoverTimer ) ; } setCursor ( control ) ; } if ( ( ! up ) && ( control != null ) ) { timerExec ( getToolTipTime ( ) , hoverTimer ) ; control . sendMouseEvent ( nsEvent , MouseMove , send ) ; } break ; } } }

Fix:
if ( ( ( ( ( nsEvent . clickCount ( ) ) == 1 ) && ( ( ( control . state ) & ( Widget . DRAG_DETECT ) ) != 0 ) ) && ( control . hooks ( DragDetect ) ) ) && ( control . dragDetect ( ) ) ) {