Buggy code:
final class MenuPersistence extends RegistryPersistence { private static final int INDEX_ACTION_SETS = 0 ; private static final int INDEX_GROUPS = 1 ; private static final int INDEX_ITEMS = 2 ; private static final int INDEX_MENUS = 3 ; private static final int INDEX_WIDGETS = 4 ; private static final Collection menuContributions = new ArrayList ( ) ; private static final void clearContributions ( final IMenuService menuService ) { } private static final void readActionSetsFromRegistry ( final IConfigurationElement [ ] configurationElements , final int configurationElementCount , final IMenuService menuService ) { } private static final SBar readBarFromRegistry ( final IConfigurationElement parentElement , final List warningsToLog , final String id ) { } private static final IDynamicMenu readDynamicMenuFromRegistry ( final IConfigurationElement parentElement , final String id , final List warningsToLog ) { } private static final void readGroupsFromRegistry ( final IConfigurationElement [ ] configurationElements , final int configurationElementCount , final IMenuService menuService ) { } private static final void readItemsFromRegistry ( final IConfigurationElement [ ] configurationElements , final int configurationElementCount , final IMenuService menuService , final ICommandService commandService ) { } private static final SLayout readLayoutFromRegistry ( final IConfigurationElement parentElement , final String id , final List warningsToLog ) { } private static final SLocation [ ] readLocationElementsFromRegistry ( final IConfigurationElement parentElement , final String id , final List warningsToLog ) { } private static final LocationElement readMenuLocationFromRegistry ( final IConfigurationElement parentElement , final List warningsToLog , final String id ) { } private static final void readMenusFromRegistry ( final IConfigurationElement [ ] configurationElements , final int configurationElementCount , final IMenuService menuService ) { } private static final SOrder readOrderingFromRegistry ( final IConfigurationElement parentElement , final String id , final List warningsToLog ) { } private static final SPart readPartFromRegistry ( final IConfigurationElement parentElement , final List warningsToLog , final String id ) { } private static final SPopup readPopupFromRegistry ( final IConfigurationElement parentElement , final List warningsToLog , final String id ) { } private static final SReference [ ] readReferencesFromRegistry ( final IConfigurationElement parentElement , final String id , final List warningsToLog ) { } private static final void readWidgetsFromRegistry ( final IConfigurationElement [ ] configurationElements , final int configurationElementCount , final IMenuService menuService ) { } private final ICommandService commandService ; private final IMenuService menuService ; MenuPersistence ( final IMenuService menuService , final ICommandService commandService ) { } public final void dispose ( ) { } protected final boolean isChangeImportant ( final IRegistryChangeEvent event ) { } protected final void read ( ) { } private static List retryList = null ; public static void readAdditions ( IMenuService menuService ) { } private static void readMenuAddition ( IMenuService menuService , IConfigurationElement addition ) { String locationURI = addition . getAttribute ( TAG_LOCATION_URI ) ; MenuLocationURI uri = new MenuLocationURI ( locationURI ) ; if ( uri != null ) { MenuAddition additionCache = menuService . getManagerForURI ( uri ) ; if ( additionCache == null ) { String p = uri . getQuery ( ) ; if ( ( p . length ( ) ) == 0 ) { <START_BUG> additionCache = new MenuAddition ( addition ) ; <END_BUG> menuService . registerAdditionCache ( uri , additionCache ) ; } else { MenuPersistence . retryList . add ( addition ) ; return ; } } int insertionIndex = MenuPersistence . getInsertionIndexForURI ( additionCache , uri ) ; additionCache . readAdditions ( addition , insertionIndex ) ; } } private static int getInsertionIndexForURI ( MenuAddition mgr , MenuLocationURI uri ) { } }

Fix:
additionCache = new MenuAddition ( addition , menuService ) ;