Buggy code:
public final class CommandContributionItem extends ContributionItem { public static final int STYLE_PUSH = SWT . PUSH ; public static final int STYLE_CHECK = SWT . CHECK ; public static final int STYLE_RADIO = SWT . RADIO ; public static final int STYLE_PULLDOWN = SWT . DROP_DOWN ; private LocalResourceManager localResourceManager ; private Listener menuItemListener ; private Widget widget ; private IMenuService menuService ; private ICommandService commandService ; private IHandlerService handlerService ; private IBindingService bindingService ; private ParameterizedCommand command ; private ImageDescriptor icon ; private String label ; private String tooltip ; private ImageDescriptor disabledIcon ; private ImageDescriptor hoverIcon ; private String mnemonic ; private IElementReference elementRef ; private boolean checkedState ; private int style ; private ICommandListener commandListener ; private String dropDownMenuOverride ; private IWorkbenchHelpSystem workbenchHelpSystem ; private String helpContextId ; private boolean visibleEnabled ; public CommandContributionItem ( CommandContributionItemParameter contributionParameters ) { } public CommandContributionItem ( IServiceLocator serviceLocator , String id , String commandId , Map parameters , ImageDescriptor icon , ImageDescriptor disabledIcon , ImageDescriptor hoverIcon , String label , String mnemonic , String tooltip , int style ) { } private void setImages ( IServiceLocator locator , String iconStyle ) { } private ICommandListener getCommandListener ( ) { } ParameterizedCommand getCommand ( ) { } void createCommand ( String commandId , Map parameters ) { } public void fill ( Menu parent , int index ) { } public void fill ( ToolBar parent , int index ) { } public void update ( ) { } public void update ( String id ) { if ( ( widget ) != null ) { if ( ( widget ) instanceof MenuItem ) { MenuItem item = ( ( MenuItem ) ( widget ) ) ; String text = label ; if ( text == null ) { if ( ( command ) != null ) { try { text = command . getCommand ( ) . getName ( ) ; } catch ( NotDefinedException e ) { WorkbenchPlugin . log ( ( "Update<seq2seq4repair_space>item<seq2seq4repair_space>failed<seq2seq4repair_space>" + ( getId ( ) ) ) , e ) ; } } } text = updateMnemonic ( text ) ; String keyBindingText = null ; if ( ( command ) != null ) { <START_BUG> TriggerSequence binding = bindingService . getBestActiveBindingFor ( command . getId ( ) ) ; <END_BUG> if ( binding != null ) { keyBindingText = binding . format ( ) ; } } if ( text != null ) { if ( keyBindingText == null ) { item . setText ( text ) ; } else { item . setText ( ( ( text + '\t' ) + keyBindingText ) ) ; } } updateIcons ( ) ; if ( ( item . getSelection ( ) ) != ( checkedState ) ) { item . setSelection ( checkedState ) ; } boolean shouldBeEnabled = isEnabled ( ) ; if ( ( item . getEnabled ( ) ) != shouldBeEnabled ) { item . setEnabled ( shouldBeEnabled ) ; } } else if ( ( widget ) instanceof ToolItem ) { ToolItem item = ( ( ToolItem ) ( widget ) ) ; if ( ( icon ) != null ) { updateIcons ( ) ; } else if ( ( label ) != null ) { item . setText ( label ) ; } if ( ( tooltip ) != null ) item . setToolTipText ( tooltip ) ; else { String text = label ; if ( text == null ) { if ( ( command ) != null ) { try { text = command . getCommand ( ) . getName ( ) ; } catch ( NotDefinedException e ) { WorkbenchPlugin . log ( ( "Update<seq2seq4repair_space>item<seq2seq4repair_space>failed<seq2seq4repair_space>" + ( getId ( ) ) ) , e ) ; } } } if ( text != null ) { item . setToolTipText ( text ) ; } } if ( ( item . getSelection ( ) ) != ( checkedState ) ) { item . setSelection ( checkedState ) ; } boolean shouldBeEnabled = isEnabled ( ) ; if ( ( item . getEnabled ( ) ) != shouldBeEnabled ) { item . setEnabled ( shouldBeEnabled ) ; } } } } private String updateMnemonic ( String s ) { } private void handleWidgetDispose ( Event event ) { } public void dispose ( ) { } private void disposeOldImages ( ) { } private Listener getItemListener ( ) { } private void handleWidgetSelection ( Event event ) { } private boolean openDropDownMenu ( Event event ) { } private void setIcon ( ImageDescriptor desc ) { } private void updateIcons ( ) { } private void setText ( String text ) { } private void setChecked ( boolean checked ) { } private void setTooltip ( String text ) { } private void setDisabledIcon ( ImageDescriptor desc ) { } private void setHoverIcon ( ImageDescriptor desc ) { } public boolean isEnabled ( ) { } public boolean isVisible ( ) { } }

Fix:
TriggerSequence binding = bindingService . getBestActiveBindingFor ( command ) ;