Buggy code:
public class ActionPresentation { private WorkbenchWindow window ; private HashMap mapDescToRec = new HashMap ( 3 ) ; private HashMap invisibleBars = new HashMap ( 3 ) ; private class SetRec { public SetRec ( IActionSetDescriptor desc , IActionSet set , SubActionBars bars ) { } public IActionSetDescriptor desc ; public IActionSet set ; public SubActionBars bars ; } public ActionPresentation ( WorkbenchWindow window ) { } public void clearActionSets ( ) { } public void removeActionSet ( IActionSetDescriptor desc ) { } public void setActionSets ( IActionSetDescriptor [ ] newArray ) { HashSet newList = new HashSet ( ) ; for ( int i = 0 ; i < ( newArray . length ) ; i ++ ) { IActionSetDescriptor descriptor = newArray [ i ] ; newList . add ( descriptor ) ; } List oldList = new ArrayList ( mapDescToRec . keySet ( ) ) ; Iterator iter = oldList . iterator ( ) ; while ( iter . hasNext ( ) ) { IActionSetDescriptor desc = ( ( IActionSetDescriptor ) ( iter . next ( ) ) ) ; if ( ! ( newList . contains ( desc ) ) ) { ActionPresentation . SetRec rec = ( ( ActionPresentation . SetRec ) ( mapDescToRec . get ( desc ) ) ) ; if ( rec != null ) { mapDescToRec . remove ( desc ) ; IActionSet set = rec . set ; SubActionBars bars = rec . bars ; if ( bars != null ) { ActionPresentation . SetRec invisibleRec = new ActionPresentation . SetRec ( desc , set , bars ) ; invisibleBars . put ( desc , invisibleRec ) ; bars . deactivate ( ) ; } } } } ArrayList sets = new ArrayList ( ) ; for ( int i = 0 ; i < ( newArray . length ) ; i ++ ) { IActionSetDescriptor desc = newArray [ i ] ; if ( ! ( mapDescToRec . containsKey ( desc ) ) ) { try { ActionPresentation . SetRec rec ; if ( invisibleBars . containsKey ( desc ) ) { rec = ( ( ActionPresentation . SetRec ) ( invisibleBars . get ( desc ) ) ) ; if ( ( rec . bars ) != null ) { rec . bars . activate ( ) ; } invisibleBars . remove ( desc ) ; } else { IActionSet set = desc . createActionSet ( ) ; <START_BUG> SubActionBars bars = new ActionSetActionBars ( window . getActionBars ( ) , desc . getId ( ) ) ; <END_BUG> rec = new ActionPresentation . SetRec ( desc , set , bars ) ; set . init ( window , bars ) ; sets . add ( set ) ; Object [ ] existingRegistrations = window . getExtensionTracker ( ) . getObjects ( desc . getConfigurationElement ( ) . getDeclaringExtension ( ) ) ; if ( ( ( existingRegistrations . length ) == 0 ) || ( ! ( containsRegistration ( existingRegistrations , desc ) ) ) ) { window . getExtensionTracker ( ) . registerObject ( desc . getConfigurationElement ( ) . getDeclaringExtension ( ) , desc , IExtensionTracker . REF_WEAK ) ; } } mapDescToRec . put ( desc , rec ) ; } catch ( CoreException e ) { WorkbenchPlugin . log ( ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>create<seq2seq4repair_space>ActionSet:<seq2seq4repair_space>" + ( desc . getId ( ) ) ) , e ) ; } } } PluginActionSetBuilder . processActionSets ( sets , window ) ; iter = sets . iterator ( ) ; while ( iter . hasNext ( ) ) { PluginActionSet set = ( ( PluginActionSet ) ( iter . next ( ) ) ) ; set . getBars ( ) . activate ( ) ; } } private boolean containsRegistration ( Object [ ] existingRegistrations , IActionSetDescriptor set ) { } public IActionSet [ ] getActionSets ( ) { } }

Fix:
SubActionBars bars = new ActionSetActionBars ( window . getActionBars ( ) , window , desc . getId ( ) ) ;