Buggy code:
ShortcutMenu ( CustomizePerspectiveDialog . ShortcutMenu parent , String id , String label ) { } void addItem ( Object item ) { } void addCheckedItem ( Object item ) { } public String toString ( ) { } ArrayList getCheckedItems ( ) { } ArrayList getCheckedItemIds ( ) { } ArrayList getChildren ( ) { } ArrayList getItems ( ) { } private String getMenuId ( ) { } ArrayList getSubtreeItems ( ) { } Object getItem ( String menuItemId ) { } boolean isFullyChecked ( ) { } boolean isFullyUnchecked ( ) { } void removeCheckedItem ( Object item ) { } void checked ( boolean checked ) { } } class TreeContentProvider implements ITreeContentProvider { public void dispose ( ) { } public Object [ ] getChildren ( Object element ) { } public Object [ ] getElements ( Object element ) { } public Object getParent ( Object element ) { } public boolean hasChildren ( Object element ) { } public void inputChanged ( Viewer viewer , Object oldInput , Object newInput ) { } } class ActionSetLabelProvider extends LabelProvider { private Map imageTable = new Hashtable ( ) ; public void dispose ( ) { } public Image getImage ( Object element ) { } public String getText ( Object element ) { } } public CustomizePerspectiveDialog ( IWorkbenchWindowConfigurer configurer , Perspective persp ) { } private void addActionSetsListeners ( ) { } private void addShortcutListeners ( ) { } private void buildMenusAndToolbarsFor ( CustomizePerspectiveDialog . CustomizeActionBars customizeActionBars , ActionSetDescriptor actionSetDesc ) { } private void checkInitialActionSetSelections ( ) { } private void checkInitialMenuCategorySelections ( CustomizePerspectiveDialog . ShortcutMenu menu ) { } public boolean close ( ) { } protected void configureShell ( Shell shell ) { } boolean containsActionSet ( MenuManager mgr , String actionSetId ) { } private Composite createActionSetsPage ( Composite parent ) { GridData data ; Composite actionSetsComposite = new Composite ( parent , SWT . NONE ) ; GridLayout layout = new GridLayout ( ) ; actionSetsComposite . setLayout ( layout ) ; Label label = new Label ( actionSetsComposite , SWT . WRAP ) ; label . setText ( NLS . bind ( ActionSetSelection_selectActionSetsLabel , perspective . getDesc ( ) . getLabel ( ) ) ) ; data = new GridData ( SWT . FILL , SWT . CENTER , true , false ) ; label . setLayoutData ( data ) ; Label sep = new Label ( actionSetsComposite , ( ( SWT . HORIZONTAL ) | ( SWT . SEPARATOR ) ) ) ; sep . setLayoutData ( new GridData ( SWT . FILL , SWT . CENTER , true , false ) ) ; SashForm sashComposite = new SashForm ( actionSetsComposite , SWT . HORIZONTAL ) ; data = new GridData ( SWT . FILL , SWT . FILL , true , true ) ; sashComposite . setLayoutData ( data ) ; Composite actionSetGroup = new Composite ( sashComposite , SWT . NONE ) ; layout = new GridLayout ( ) ; layout . marginHeight = 0 ; layout . marginWidth = 0 ; actionSetGroup . setLayout ( layout ) ; actionSetGroup . setLayoutData ( new GridData ( SWT . FILL , SWT . FILL , true , true ) ) ; label = new Label ( actionSetGroup , SWT . WRAP ) ; label . setText ( ActionSetSelection_availableActionSets ) ; label . setLayoutData ( new GridData ( SWT . FILL , SWT . CENTER , true , false ) ) ; actionSetsViewer = CheckboxTableViewer . newCheckList ( actionSetGroup , ( ( ( SWT . BORDER ) | ( SWT . H_SCROLL ) ) | ( SWT . V_SCROLL ) ) ) ; actionSetsViewer . getTable ( ) . setLayoutData ( new GridData ( SWT . FILL , SWT . FILL , true , true ) ) ; actionSetsViewer . setLabelProvider ( new WorkbenchLabelProvider ( ) ) ; actionSetsViewer . setContentProvider ( new ArrayContentProvider ( ) ) ; <START_BUG> actionSetsViewer . setSorter ( new ActionSetSorter ( ) ) ; <END_BUG> Composite actionGroup = new Composite ( sashComposite , SWT . NONE ) ; layout = new GridLayout ( ) ; layout . numColumns = 2 ; layout . makeColumnsEqualWidth = true ; layout . marginHeight = 0 ; layout . marginWidth = 0 ; layout . horizontalSpacing = 0 ; actionGroup . setLayout ( layout ) ; actionGroup . setLayoutData ( new GridData ( SWT . FILL , SWT . FILL , true , true ) ) ; Composite menubarGroup = new Composite ( actionGroup , SWT . NONE ) ; layout = new GridLayout ( ) ; layout . marginHeight = 0 ; layout . marginWidth = 0 ; menubarGroup . setLayout ( layout ) ; menubarGroup . setLayoutData ( new GridData ( SWT . FILL , SWT . FILL , true , true ) ) ; label = new Label ( menubarGroup , SWT . WRAP ) ; label . setText ( ActionSetSelection_menubarActions ) ; label . setLayoutData ( new GridData ( SWT . FILL , SWT . CENTER , true , false ) ) ; actionSetMenuViewer = new TreeViewer ( menubarGroup ) ; actionSetMenuViewer . setAutoExpandLevel ( ALL_LEVELS ) ; actionSetMenuViewer . getControl ( ) . setLayoutData ( new GridData ( SWT . FILL , SWT . FILL , true , true ) ) ; actionSetMenuViewer . setLabelProvider ( new CustomizePerspectiveDialog . ActionSetLabelProvider ( ) ) ; actionSetMenuViewer . setContentProvider ( new CustomizePerspectiveDialog . TreeContentProvider ( ) ) ; Composite toolbarGroup = new Composite ( actionGroup , SWT . NONE ) ; layout = new GridLayout ( ) ; layout . marginHeight = 0 ; layout . marginWidth = 0 ; toolbarGroup . setLayout ( layout ) ; toolbarGroup . setLayoutData ( new GridData ( SWT . FILL , SWT . FILL , true , true ) ) ; label = new Label ( toolbarGroup , SWT . WRAP ) ; label . setText ( ActionSetSelection_toolbarActions ) ;

Fix:
actionSetsViewer . setComparator ( new ActionSetSorter ( ) ) ;