Buggy code:
; static final String [ ] [ ] DETAIL_CONSTANTS = new String [ ] [ ] { new String [ ] { "SWT.COMPOSITION_CHANGED" , "SWT.COMPOSITION_OFFSET" , "SWT.COMPOSITION_SELECTION" } , new String [ ] { "SWT.SELECTED" , "SWT.FOCUSED" , "SWT.BACKGROUND" , "SWT.FOREGROUND" , "SWT.HOT" } , new String [ ] { "SWT.TRAVERSE_NONE" , "SWT.TRAVERSE_ESCAPE" , "SWT.TRAVERSE_RETURN" , "SWT.TRAVERSE_TAB_PREVIOUS" , "SWT.TRAVERSE_TAB_NEXT" , "SWT.TRAVERSE_ARROW_PREVIOUS" , "SWT.TRAVERSE_ARROW_NEXT" , "SWT.TRAVERSE_MNEMONIC" , "SWT.TRAVERSE_PAGE_PREVIOUS" , "SWT.TRAVERSE_PAGE_NEXT" } } ; static final Object [ ] DETAIL_VALUES = new Object [ ] { "SWT.COMPOSITION_CHANGED" , new Integer ( SWT . COMPOSITION_CHANGED ) , "SWT.COMPOSITION_OFFSET" , new Integer ( SWT . COMPOSITION_OFFSET ) , "SWT.COMPOSITION_SELECTION" , new Integer ( SWT . COMPOSITION_SELECTION ) , "SWT.SELECTED" , new Integer ( SWT . SELECTED ) , "SWT.FOCUSED" , new Integer ( SWT . FOCUSED ) , "SWT.BACKGROUND" , new Integer ( SWT . BACKGROUND ) , "SWT.FOREGROUND" , new Integer ( SWT . FOREGROUND ) , "SWT.HOT" , new Integer ( SWT . HOT ) , "SWT.TRAVERSE_NONE" , new Integer ( SWT . TRAVERSE_NONE ) , "SWT.TRAVERSE_ESCAPE" , new Integer ( SWT . TRAVERSE_ESCAPE ) , "SWT.TRAVERSE_RETURN" , new Integer ( SWT . TRAVERSE_RETURN ) , "SWT.TRAVERSE_TAB_PREVIOUS" , new Integer ( SWT . TRAVERSE_TAB_PREVIOUS ) , "SWT.TRAVERSE_TAB_NEXT" , new Integer ( SWT . TRAVERSE_TAB_NEXT ) , "SWT.TRAVERSE_ARROW_PREVIOUS" , new Integer ( SWT . TRAVERSE_ARROW_PREVIOUS ) , "SWT.TRAVERSE_ARROW_NEXT" , new Integer ( SWT . TRAVERSE_ARROW_NEXT ) , "SWT.TRAVERSE_MNEMONIC" , new Integer ( SWT . TRAVERSE_MNEMONIC ) , "SWT.TRAVERSE_PAGE_PREVIOUS" , new Integer ( SWT . TRAVERSE_PAGE_PREVIOUS ) , "SWT.TRAVERSE_PAGE_NEXT" , new Integer ( SWT . TRAVERSE_PAGE_NEXT ) } ; Tab ( ControlExample instance ) { } void createControlGroup ( ) { } void createSetGetGroup ( ) { } void createControlWidgets ( ) { } void createColorAndFontGroup ( ) { } void changeFontOrColor ( int index ) { } void createOtherGroup ( ) { } void createBackgroundModeGroup ( ) { } void createEditEventDialog ( Shell parent , int x , int y , final int index ) { } void createEventConsolePopup ( ) { } void createExampleGroup ( ) { } void createExampleWidgets ( ) { } void createListenerSelectionDialog ( ) { } void createListenersGroup ( ) { } String [ ] getMethodNames ( ) { } Shell createSetGetDialog ( String [ ] methodNames ) { } void resetLabels ( ) { } String setMethodName ( String methodRoot ) { } String parameterInfo ( String methodRoot ) { } void getValue ( ) { } Class getReturnType ( String methodRoot ) { } void setValue ( ) { } Object [ ] parameterForType ( String typeName , String value , Widget widget ) { } void createOrientationGroup ( ) { } void createSizeGroup ( ) { } void createStyleGroup ( ) { } Composite createTabFolderPage ( TabFolder tabFolder ) { } void setExampleWidgetPopupMenu ( ) { Control [ ] controls = getExampleControls ( ) ; for ( int i = 0 ; i < ( controls . length ) ; i ++ ) { final Control control = controls [ i ] ; control . addListener ( MenuDetect , new Listener ( ) { public void handleEvent ( Event event ) { Menu menu = control . getMenu ( ) ; if ( ( menu != null ) && ( samplePopup ) ) { menu . dispose ( ) ; menu = null ; } if ( ( menu == null ) && ( popupMenuButton . getSelection ( ) ) ) { <START_BUG> menu = new Menu ( shell , SWT . POP_UP ) ; <END_BUG> MenuItem item = new MenuItem ( menu , SWT . PUSH ) ; item . setText ( "Sample<seq2seq4repair_space>popup<seq2seq4repair_space>menu<seq2seq4repair_space>item" ) ; specialPopupMenuItems ( menu , event ) ; control . setMenu ( menu ) ; samplePopup = true ; } } } ) ; } } protected void specialPopupMenuItems ( final Menu menu , final Event event ) { } void disposeExampleWidgets ( ) { } Image colorImage ( Color color ) { } Image fontImage ( Font font ) { } String [ ] getCustomEventNames ( ) { } int getDefaultStyle ( ) { } Widget [ ] getExampleWidgets ( ) { } Control [ ] getExampleControls ( ) { } Item [ ] getExampleWidgetItems ( ) { } String getShortTabText ( ) { } String getTabText ( ) { }

Fix:
menu = new Menu ( shell , ( ( SWT . POP_UP ) | ( ( control . getStyle ( ) ) & ( ( SWT . RIGHT_TO_LEFT ) | ( SWT . LEFT_TO_RIGHT ) ) ) ) ) ;