Buggy code:
public final class LegacyActionPersistence extends RegistryPersistence { private static final int INDEX_ACTION_SETS = 0 ; private static final int INDEX_EDITOR_CONTRIBUTIONS = 1 ; private static final int INDEX_OBJECT_CONTRIBUTIONS = 2 ; private static final int INDEX_VIEW_CONTRIBUTIONS = 3 ; private static final int INDEX_VIEWER_CONTRIBUTIONS = 4 ; private static final SLocation createLocation ( final String barType , final String path , final LegacyLocationInfo locationInfo , final char mnemonic , final String imageStyle ) { } private static final Expression readVisibility ( final IConfigurationElement parentElement , final String parentId , final List warningsToLog ) { } private final BindingManager bindingManager ; private final CommandImageManager commandImageManager ; private final CommandManager commandManager ; private final Collection menuContributions = new ArrayList ( ) ; private final IMenuService menuService ; public LegacyActionPersistence ( final CommandManager commandManager , final BindingManager bindingManager , final CommandImageManager commandImageManager , final IMenuService menuService ) { } private final void clearBindings ( ) { } private final void clearImages ( ) { } private final void clearMenus ( ) { } private final void convertActionToBinding ( final IConfigurationElement element , final ParameterizedCommand command ) { } private final ParameterizedCommand convertActionToCommand ( final IConfigurationElement element , final String primaryId , final String secondaryId , final List warningsToLog ) { } private final String convertActionToImages ( final IConfigurationElement element , final ParameterizedCommand command ) { } private final void convertActionToItem ( final IConfigurationElement element , final List warningsToLog , final ParameterizedCommand command , final String imageStyle , final LegacyLocationInfo locationInfo , final Expression visibleWhenExpression ) { final String commandId = command . getId ( ) ; final String id = readRequired ( element , ATTRIBUTE_ID , warningsToLog , "Actions<seq2seq4repair_space>require<seq2seq4repair_space>an<seq2seq4repair_space>id" , commandId ) ; if ( id == null ) { return ; } final String label = readOptional ( element , ATTRIBUTE_LABEL ) ; final char mnemonic = LegacyActionTools . extractMnemonic ( label ) ; final String menubarPath = readOptional ( element , ATTRIBUTE_MENUBAR_PATH ) ; final String toolbarPath = readOptional ( element , ATTRIBUTE_TOOLBAR_PATH ) ; int locationCount = 0 ; if ( menubarPath != null ) { locationCount ++ ; } if ( toolbarPath != null ) { locationCount ++ ; } final SLocation [ ] locations ; if ( locationCount == 0 ) { locations = null ; } else { locations = new SLocation [ locationCount ] ; int i = 0 ; if ( menubarPath != null ) { locations [ ( i ++ ) ] = LegacyActionPersistence . createLocation ( TYPE_MENU , menubarPath , locationInfo , mnemonic , imageStyle ) ; } if ( toolbarPath != null ) { <START_BUG> locations [ ( i ++ ) ] = LegacyActionPersistence . createLocation ( TYPE_TOOL , toolbarPath , locationInfo , mnemonic , imageStyle ) ; <END_BUG> } } if ( isPulldown ( element ) ) { final SWidget widget = menuService . getWidget ( id ) ; final IWidget proxy = new PulldownDelegateWidgetProxy ( element , ATTRIBUTE_CLASS ) ; widget . define ( proxy , locations ) ; final IMenuContribution contribution = menuService . contributeMenu ( widget , visibleWhenExpression ) ; menuContributions . add ( contribution ) ; } else { final SItem item = menuService . getItem ( id ) ; item . define ( command , id , locations ) ; final IMenuContribution contribution = menuService . contributeMenu ( item , visibleWhenExpression ) ; menuContributions . add ( contribution ) ; } } protected final boolean isChangeImportant ( final IRegistryChangeEvent event ) { } public final void dispose ( ) { } public final void read ( ) { } private final SReference [ ] readActions ( final String primaryId , final IConfigurationElement [ ] elements , final List warningsToLog , final LegacyLocationInfo locationInfo , final Expression visibleWhenExpression ) { } private final SReference [ ] readActionsAndMenus ( final IConfigurationElement element , final String id , final List warningsToLog , final LegacyLocationInfo locationInfo , final Expression visibleWhenExpression ) { } private final void readActionSets ( final IConfigurationElement [ ] configurationElements , final int configurationElementCount ) { } private final void readEditorContributions ( final IConfigurationElement [ ] configurationElements , final int configurationElementCount ) { } private final SReference [ ] readGroups ( final IConfigurationElement [ ] elements , final List warningsToLog , final String path , final LegacyLocationInfo locationInfo , final Expression visibleWhenExpression , final boolean separatorsVisible ) { } private final SReference [ ] readMenusAndGroups ( final IConfigurationElement [ ] menuElements , final String contributionId , final List warningsToLog , final LegacyLocationInfo locationInfo , final Expression visibleWhenExpression ) { } private final void readObjectContributions ( final IConfigurationElement [ ] configurationElements , final int configurationElementCount ) { } private final void readViewContributions ( final IConfigurationElement [ ] configurationElements , final int configurationElementCount ) { } private final void readViewerContributions ( final IConfigurationElement [ ] configurationElements , final int configurationElementCount ) { } }

Fix:
locations [ ( i ++ ) ] = LegacyActionPersistence . createLocation ( TYPE_TRIM , toolbarPath , locationInfo , mnemonic , imageStyle ) ;