Buggy code:
public class MenuBuilder extends UIBuilder implements IAcceleratorChangeListener { private static class MenuPath { static MenuBuilder . MenuPath emptyPath ( ) { } String parentKey ; String key ; MenuPath ( final String key ) { } void setKey ( final String name ) { } void setLastKeySection ( final String name ) { } @ Override public String toString ( ) { } } private class MenuStructureReader { private final class ActionCreator implements IElementHandler { public Object createElement ( final Object parent , final String tag , final XMLElement attributes ) { } } private final class CategoryCreator implements IElementHandler { public Object createElement ( final Object parent , final String tag , final XMLElement attributes ) { } } private final class SeparatorCreator implements IElementHandler { public Object createElement ( final Object parent , final String tag , final XMLElement attributes ) { } } private final class StructureCreator implements IElementHandler { public Object createElement ( final Object parent , final String tag , final XMLElement attributes ) { } } private ButtonGroup buttonGroup ; private final ReadManager readManager ; public MenuStructureReader ( ) { } public void processMenu ( final URL menu ) { } } private static Insets nullInsets = new Insets ( 0 , 0 , 0 , 0 ) ; private static final String SHORTCUT_PROPERTY_PREFIX = "acceleratorFor" ; static final int MAX_HEIGHT ; private final ModeController modeController ; final MenuBuilder . MenuStructureReader reader ; private Set < String > plugins ; private final Map < AFreeplaneAction , Node > actionNodeMap ; private final ActionAcceleratorManager acceleratorManager ; public MenuBuilder ( ModeController modeController , ActionAcceleratorManager acceleratorManager ) { } public void addAction ( final String category , final AFreeplaneAction action , final int position ) { } public String getMenuKey ( final String category , String actionKey ) { } public void addAction ( final String category , final String key , final AFreeplaneAction action , final int position ) { } private void addListeners ( final String key , final AFreeplaneAction action ) { } private void addButton ( final String category , final Action action , final String key , final int position ) { } @ Override protected void addComponent ( final Container container , final Component component , final int index ) { } public void addComponent ( final String parent , final Container item , final Action action , final int position ) { } public void addMenuBar ( final JMenuBar menubar , final String key ) { } public void addMenuItem ( final String relativeKey , final JMenuItem item , final String key , final int position ) { } public void addMenuItemGroup ( final String key , final int position ) { } public void addMenuItemGroup ( final String relativeKey , final String key , final int position ) { } public void addPopupMenu ( final JPopupMenu menu , final String key ) { } public void addPopupMenuListener ( final Object key , final PopupMenuListener listener ) { } public void addPopupMenuListener ( final DefaultMutableTreeNode node , final PopupMenuListener listener ) { } public JMenuItem addRadioItem ( final String category , final AFreeplaneAction action , final boolean isSelected ) { } public JMenuItem addRadioItem ( final String category , final String key , final AFreeplaneAction action , final boolean isSelected ) { } public void addSeparator ( ) { } public void addSeparator ( final String parentKey , final int position ) { } public void addToolbar ( final JToolBar toolbar , final String key ) { } public void afterMapChange ( final MapModel newMap ) { } IFreeplaneAction decorateAction ( final String category , final AFreeplaneAction action ) { } public IFreeplaneAction acceleratableAction ( final AFreeplaneAction action ) { } @ Override protected Component getChildComponent ( final Container parentComponent , final int index ) { } @ Override protected Container getNextParentComponent ( Container parentComponent ) { } public Node getMenuBar ( DefaultMutableTreeNode element ) { } @ Override protected DefaultMutableTreeNode getNode ( final Object parentKey ) { } @ Override protected int getParentComponentCount ( final Container parentComponent ) { } public String getShortcutKey ( final String key ) { } public void processMenuCategory ( final URL menu , Set < String > plugins ) { } private void removeAcceleratorForAction ( AFreeplaneAction action ) { } @ SuppressWarnings ( "unchecked" ) private void removeAcceleratorsRecursive ( final DefaultMutableTreeNode node ) { } @ Override protected void removeChildComponents ( final Container parentComponent , final DefaultMutableTreeNode node ) { } public void removePopupMenuListener ( final Object key , final PopupMenuListener listener ) { } public Map < KeyStroke , Node > getAcceleratorMap ( ) { Map < KeyStroke , AFreeplaneAction > actionAccelMap = acceleratorManager . getAcceleratorMap ( ) ; Map < KeyStroke , Node > accelerators = new HashMap < KeyStroke , IndexedTree . Node > ( ) ; for ( Map . Entry < KeyStroke , AFreeplaneAction > entry : actionAccelMap . entrySet ( ) ) { <START_BUG> Node node = actionNodeMap . get ( entry . getKey ( ) ) ; <END_BUG> if ( node != null ) { accelerators . put ( entry . getKey ( ) , node ) ; } } return Collections . unmodifiableMap ( accelerators ) ; } public void acceleratorChanged ( AFreeplaneAction action , KeyStroke oldStroke , KeyStroke newStroke ) { } }

Fix:
Node node = actionNodeMap . get ( entry . getValue ( ) ) ;