Buggy code:
public final class WorkbenchMenuService extends InternalMenuService { private final class ContributionItemUpdater implements IPropertyChangeListener , IIdentifierListener { private final IContributionItem item ; private IIdentifier identifier ; private boolean lastExpressionResult = true ; private ContributionItemUpdater ( IContributionItem item , IIdentifier identifier ) { } public void propertyChange ( PropertyChangeEvent event ) { } private void updateVisibility ( ) { } public void identifierChanged ( IdentifierEvent identifierEvent ) { } public void dispose ( ) { } } private final class ManagerPopulationRecord { public IServiceLocator serviceLocatorToUse ; public Set restriction ; public String uri ; public boolean recurse ; Map factoryToItems = new HashMap ( ) ; public ManagerPopulationRecord ( IServiceLocator serviceLocatorToUse , Set restriction , String uri , boolean recurse ) { } public void addFactoryContribution ( AbstractContributionFactory factory , ContributionRoot ciList ) { } public void removeFactoryContribution ( AbstractContributionFactory factory ) { } public List getItemsForFactory ( AbstractContributionFactory factory ) { } public void clearCaches ( ) { } public void releaseContributions ( ) { } } private static final String PROP_VISIBLE = "visible" ; private final MenuPersistence menuPersistence ; private IEvaluationService evaluationService ; private IPropertyChangeListener serviceListener ; private IServiceLocator serviceLocator ; private IActivityManagerListener activityManagerListener ; public WorkbenchMenuService ( IServiceLocator serviceLocator ) { } private IActivityManagerListener getActivityManagerListener ( ) { } private IPropertyChangeListener getServiceListener ( ) { } public void updateManagers ( ) { } private void updateTrim ( ToolBarManager mgr ) { } private boolean updateCoolBar ( ToolBarManager mgr ) { } public final void addSourceProvider ( final ISourceProvider provider ) { } public final void dispose ( ) { } public final void readRegistry ( ) { } public final void removeSourceProvider ( final ISourceProvider provider ) { } private Map uriToFactories = new HashMap ( ) ; private Map evaluationsByItem = new HashMap ( ) ; private Map activityListenersByItem = new HashMap ( ) ; private Set managersAwaitingUpdates = new HashSet ( ) ; private HashMap populatedManagers = new HashMap ( ) ; private String getIdFromURI ( MenuLocationURI uri ) { } public List getAdditionsForURI ( MenuLocationURI uri ) { } public void addContributionFactory ( AbstractContributionFactory factory ) { } private List getManagersFor ( String factoryId ) { } public void removeContributionFactory ( AbstractContributionFactory factory ) { } private boolean processAdditions ( final IServiceLocator serviceLocatorToUse , Set restriction , final ContributionManager mgr , final AbstractContributionFactory cache , final Set itemsAdded ) { } protected void removeContributionsForFactory ( IContributionManager manager , AbstractContributionFactory factory ) { } private void releaseCache ( final ContributionRoot items ) { } public void populateContributionManager ( ContributionManager mgr , String uri ) { } public void populateContributionManager ( IServiceLocator serviceLocatorToUse , Set restriction , ContributionManager mgr , String uri , boolean recurse ) { } public void addContributionsToManager ( IServiceLocator serviceLocatorToUse , Set restriction , ContributionManager mgr , String uri , boolean recurse , List factories ) { } private int getInsertionIndex ( ContributionManager mgr , String location ) { MenuLocationURI uri = new MenuLocationURI ( location ) ; String query = uri . getQuery ( ) ; int additionsIndex = - 1 ; if ( ( ( query . length ( ) ) == 0 ) || ( query . equals ( "after=additions" ) ) ) { additionsIndex = mgr . indexOf ( "additions" ) ; if ( additionsIndex == ( - 1 ) ) additionsIndex = mgr . getItems ( ) . length ; else ++ additionsIndex ; } else { String [ ] queryParts = Util . split ( query , '=' ) ; <START_BUG> if ( ( queryParts [ 1 ] . length ( ) ) > 0 ) { <END_BUG> additionsIndex = mgr . indexOf ( queryParts [ 1 ] ) ; if ( ( additionsIndex != ( - 1 ) ) && ( queryParts [ 0 ] . equals ( "after" ) ) ) additionsIndex ++ ; } } return additionsIndex ; } public IEvaluationContext getCurrentState ( ) { } public void registerVisibleWhen ( final IContributionItem item , final Expression visibleWhen , final Set restriction , String identifierID ) { } public void unregisterVisibleWhen ( IContributionItem item , final Set restriction ) { } protected void releaseContributions ( ContributionRoot items ) { } public void releaseContributions ( ContributionManager mgr ) { } private void releaseItem ( IContributionItem item , final Set restriction ) { } public void handleDynamicAdditions ( List menuAdditions ) { } public void handleDynamicRemovals ( List menuRemovals ) { } private MenuAdditionCacheEntry findFactory ( IConfigurationElement ceToRemove ) { } private void handleMenuChanges ( IRegistryChangeEvent event ) { } public void handleRegistryChanges ( final IRegistryChangeEvent event ) { } public MenuPersistence getMenuPersistence ( ) { } public void populateContributionManager ( ContributionManager mgr , String uri , boolean recurse ) { } }

Fix:
if ( ( ( queryParts . length ) > 1 ) && ( ( queryParts [ 1 ] . length ( ) ) > 0 ) ) {