Buggy code:
public class CyclePartAction extends PageEventAction { String commandForward = null ; String commandBackward = null ; boolean forward ; private Object selection ; protected CyclePartAction ( IWorkbenchWindow window , boolean forward ) { } protected void setText ( ) { } public void pageActivated ( IWorkbenchPage page ) { } public void pageClosed ( IWorkbenchPage page ) { } public void partOpened ( IWorkbenchPart part ) { } public void partClosed ( IWorkbenchPart part ) { } protected void dispose ( ) { } protected void updateState ( ) { } public void runWithEvent ( Event e ) { } public void activate ( IWorkbenchPage page , Object selection ) { } private void openDialog ( WorkbenchPage page ) { } protected String getTableHeader ( ) { } protected void addItems ( Table table , WorkbenchPage page ) { } private void addKeyListener ( final Table table , final Shell dialog ) { table . addKeyListener ( new KeyListener ( ) { private boolean firstKey = true ; private boolean quickReleaseMode = false ; public void keyPressed ( KeyEvent e ) { int keyCode = e . keyCode ; int stateMask = e . stateMask ; char character = e . character ; int accelerator = stateMask | ( keyCode != 0 ? keyCode : CyclePartAction . convertCharacter ( character ) ) ; <START_BUG> KeySequence keySequence = KeySequence . getInstance ( KeySupport . convertFromSWT ( accelerator ) ) ; <END_BUG> boolean acceleratorForward = false ; boolean acceleratorBackward = false ; CommandManager commandManager = CommandManager . getInstance ( ) ; if ( ( commandForward ) != null ) { ICommand command = commandManager . getCommand ( commandForward ) ; if ( command . isDefined ( ) ) { try { SortedSet keyBindings = command . getKeyBindings ( ) ; Iterator iterator = keyBindings . iterator ( ) ; while ( iterator . hasNext ( ) ) { IKeyBinding keyBinding = ( ( IKeyBinding ) ( iterator . next ( ) ) ) ; if ( keyBinding . getKeySequence ( ) . equals ( keySequence ) ) { acceleratorForward = true ; break ; } } } catch ( NotDefinedException eNotDefined ) { } } } if ( ( commandBackward ) != null ) { ICommand command = commandManager . getCommand ( commandBackward ) ; if ( command . isDefined ( ) ) { try { SortedSet keyBindings = command . getKeyBindings ( ) ; Iterator iterator = keyBindings . iterator ( ) ; while ( iterator . hasNext ( ) ) { IKeyBinding keyBinding = ( ( IKeyBinding ) ( iterator . next ( ) ) ) ; if ( keyBinding . getKeySequence ( ) . equals ( keySequence ) ) { acceleratorBackward = true ; break ; } } } catch ( NotDefinedException eNotDefined ) { } } } if ( ( character == ( SWT . CR ) ) || ( character == ( SWT . LF ) ) ) ok ( dialog , table ) ; else if ( acceleratorForward ) { if ( ( firstKey ) && ( ( e . stateMask ) != 0 ) ) quickReleaseMode = true ; int index = table . getSelectionIndex ( ) ; table . setSelection ( ( ( index + 1 ) % ( table . getItemCount ( ) ) ) ) ; } else if ( acceleratorBackward ) { if ( ( firstKey ) && ( ( e . stateMask ) != 0 ) ) quickReleaseMode = true ; int index = table . getSelectionIndex ( ) ; table . setSelection ( ( index >= 1 ? index - 1 : ( table . getItemCount ( ) ) - 1 ) ) ; } else if ( ( ( ( ( ( ( ( keyCode != ( SWT . ALT ) ) && ( keyCode != ( SWT . COMMAND ) ) ) && ( keyCode != ( SWT . CTRL ) ) ) && ( keyCode != ( SWT . SHIFT ) ) ) && ( keyCode != ( SWT . ARROW_DOWN ) ) ) && ( keyCode != ( SWT . ARROW_UP ) ) ) && ( keyCode != ( SWT . ARROW_LEFT ) ) ) && ( keyCode != ( SWT . ARROW_RIGHT ) ) ) cancel ( dialog ) ; firstKey = false ; } public void keyReleased ( KeyEvent e ) { int keyCode = e . keyCode ; int stateMask = e . stateMask ; if ( ( ( firstKey ) || ( quickReleaseMode ) ) && ( keyCode == stateMask ) ) ok ( dialog , table ) ; } } ) ; } private static char convertCharacter ( char c ) { } private void ok ( Shell dialog , final Table table ) { } private void cancel ( Shell dialog ) { } private void addMouseListener ( final Table table , final Shell dialog ) { } }

Fix:
KeySequence keySequence = KeySequence . getInstance ( KeySupport . convertAcceleratorToKeyStroke ( accelerator ) ) ;