Buggy code:
public class WorkbenchCommandSupport implements IWorkbenchCommandSupport { private static final boolean DEBUG = Policy . DEBUG_HANDLERS ; private static final boolean DEBUG_VERBOSE = ( Policy . DEBUG_HANDLERS ) && ( Policy . DEBUG_HANDLERS_VERBOSE ) ; private static final String DEBUG_VERBOSE_COMMAND_ID = Policy . DEBUG_HANDLERS_VERBOSE_COMMAND_ID ; private static final int MATCH_ANY = 0 ; private static final int MATCH_PARTIAL = 1 ; private static final int MATCH_EXACT = 2 ; private static final int compareWindows ( final Shell shellToMatch , final Shell activeShell ) { } private Listener activationListener = new Listener ( ) { public void handleEvent ( Event event ) { } } ; private String activePartId ; private Shell activeShell ; private IWorkbenchSite activeWorkbenchSite ; private IWorkbenchWindow activeWorkbenchWindow ; private final Map handlerSubmissionsByCommandId = new HashMap ( ) ; private final CommandManagerWrapper commandManagerWrapper ; private final IPageListener pageListener = new IPageListener ( ) { public void pageActivated ( IWorkbenchPage workbenchPage ) { } public void pageClosed ( IWorkbenchPage workbenchPage ) { } public void pageOpened ( IWorkbenchPage workbenchPage ) { } } ; private final IPartListener partListener = new IPartListener ( ) { public void partActivated ( IWorkbenchPart workbenchPart ) { } public void partBroughtToTop ( IWorkbenchPart workbenchPart ) { } public void partClosed ( IWorkbenchPart workbenchPart ) { } public void partDeactivated ( IWorkbenchPart workbenchPart ) { } public void partOpened ( IWorkbenchPart workbenchPart ) { } } ; private final IPerspectiveListener perspectiveListener = new IPerspectiveListener ( ) { public void perspectiveActivated ( IWorkbenchPage workbenchPage , IPerspectiveDescriptor perspectiveDescriptor ) { } public void perspectiveChanged ( IWorkbenchPage workbenchPage , IPerspectiveDescriptor perspectiveDescriptor , String changeId ) { } } ; private boolean processing = true ; private final Workbench workbench ; public WorkbenchCommandSupport ( final Workbench workbenchToSupport , final BindingManager bindingManager , final CommandManager commandManager , final ContextManager contextManager , final CommandService commandService ) { } public void addHandlerSubmission ( HandlerSubmission handlerSubmission ) { } private final void addHandlerSubmissionReal ( final HandlerSubmission handlerSubmission ) { final String commandId = handlerSubmission . getCommandId ( ) ; List handlerSubmissions2 = ( ( List ) ( handlerSubmissionsByCommandId . get ( commandId ) ) ) ; if ( handlerSubmissions2 == null ) { <START_BUG> handlerSubmissions2 = new ArrayList ( ) ; <END_BUG> handlerSubmissionsByCommandId . put ( commandId , handlerSubmissions2 ) ; } handlerSubmissions2 . add ( handlerSubmission ) ; } public void addHandlerSubmissions ( Collection handlerSubmissions ) { } public ICommandManager getCommandManager ( ) { } private void processHandlerSubmissions ( boolean force ) { } private void processHandlerSubmissions ( boolean force , final Shell newActiveShell ) { } public void removeHandlerSubmission ( HandlerSubmission handlerSubmission ) { } private final void removeHandlerSubmissionReal ( final HandlerSubmission handlerSubmission ) { } public void removeHandlerSubmissions ( Collection handlerSubmissions ) { } public final void setProcessing ( final boolean processing ) { } }

Fix:
handlerSubmissions2 = new ArrayList ( 1 ) ;