Buggy code:
public class EditorManager implements IExtensionChangeHandler { EditorAreaHelper editorPresentation ; WorkbenchWindow window ; WorkbenchPage page ; private Map actionCache = new HashMap ( ) ; private static final String PIN_EDITOR_KEY = "PIN_EDITOR" ; private static final String PIN_EDITOR = "ovr16//pinned_ovr.gif" ; private IPropertyChangeListener editorPropChangeListnener = null ; private IHandlerActivation pinEditorHandlerActivation = null ; static final String RESOURCES_TO_SAVE_MESSAGE = WorkbenchMessages . EditorManager_saveResourcesMessage ; static final String SAVE_RESOURCES_TITLE = WorkbenchMessages . EditorManager_saveResourcesTitle ; public EditorManager ( WorkbenchWindow window , WorkbenchPage workbenchPage , EditorAreaHelper pres ) { } void checkDeleteEditorResources ( ) { } void checkCreateEditorPropListener ( ) { } void checkCreatePinEditorShortcutKeyHandler ( ) { if ( ( pinEditorHandlerActivation ) == null ) { final Shell shell = window . getShell ( ) ; final IHandler pinEditorHandler = new AbstractHandler ( ) { public final Object execute ( final ExecutionEvent event ) { IPreferenceStore store = WorkbenchPlugin . getDefault ( ) . getPreferenceStore ( ) ; if ( ( store . getBoolean ( REUSE_EDITORS_BOOLEAN ) ) || ( ( ( org . eclipse . ui . internal . tweaklets . TabBehaviour ) ( org . eclipse . ui . internal . tweaklets . Tweaklets . get ( TabBehaviour . KEY ) ) ) . alwaysShowPinAction ( ) ) ) { IWorkbenchPartReference ref = editorPresentation . getVisibleEditor ( ) ; if ( ref instanceof WorkbenchPartReference ) { WorkbenchPartReference concreteRef = ( ( WorkbenchPartReference ) ( ref ) ) ; concreteRef . setPinned ( concreteRef . isPinned ( ) ) ; } } return null ; } } ; final IHandlerService handlerService = ( ( IHandlerService ) ( window . getWorkbench ( ) . getService ( IHandlerService . class ) ) ) ; <START_BUG> pinEditorHandlerActivation = handlerService . activateHandler ( WINDOW_PINEDITOR , pinEditorHandler , new org . eclipse . ui . ActiveShellExpression ( shell ) ) ; <END_BUG> } } ImageDescriptor getEditorPinImageDesc ( ) { } private List collectDirtyEditors ( ) { } public boolean containsEditor ( IEditorReference ref ) { } private EditorActionBars createEditorActionBars ( EditorDescriptor desc , final IEditorSite site ) { } private EditorActionBars createEmptyEditorActionBars ( final IEditorSite site ) { } void disposeEditorActionBars ( EditorActionBars actionBars ) { } public IEditorPart findEditor ( IEditorInput input ) { } public IEditorPart findEditor ( String editorId , IEditorInput input , int matchFlags ) { } public IEditorReference [ ] findEditors ( IEditorInput input , String editorId , int matchFlags ) { } private void findEditors ( List editorList , IEditorInput input , String editorId , int matchFlags , List result ) { } private Display getDisplay ( ) { } public int getEditorCount ( ) { } private IEditorRegistry getEditorRegistry ( ) { } public IEditorPart [ ] getDirtyEditors ( ) { } public IEditorReference [ ] getEditors ( ) { } public IEditorPart getVisibleEditor ( ) { } public boolean isSaveAllNeeded ( ) { } private IEditorReference findReusableEditor ( EditorDescriptor desc ) { } public IEditorReference openEditor ( String editorId , IEditorInput input , boolean setVisible , IMemento editorState ) throws PartInitException { } public IEditorReference openEditorFromDescriptor ( EditorDescriptor desc , IEditorInput input , IMemento editorState ) throws PartInitException { } private IEditorReference openExternalEditor ( final EditorDescriptor desc , IEditorInput input ) throws PartInitException { } IEditorReference [ ] openMultiEditor ( final IEditorReference ref , final AbstractMultiEditor part , final MultiEditorInput input ) throws PartInitException { } private void createEditorTab ( final EditorReference ref , final String workbookId ) throws PartInitException { } EditorSite createSite ( final IEditorReference ref , final IEditorPart part , final EditorDescriptor desc , final IEditorInput input ) throws PartInitException { } private IEditorReference reuseInternalEditor ( EditorDescriptor desc , IEditorInput input ) throws PartInitException { } IEditorPart createPart ( final EditorDescriptor desc ) throws PartInitException { } private IEditorReference openSystemExternalEditor ( final IPath location ) throws PartInitException { } ImageDescriptor findImage ( EditorDescriptor desc , IPath path ) { } public IStatus restoreState ( IMemento memento ) { } public boolean saveAll ( boolean confirm , boolean closing , boolean addNonPartSources ) { } public static boolean saveAll ( List dirtyParts , boolean confirm , boolean closing , boolean addNonPartSources , final IWorkbenchWindow window ) { } public static boolean saveAll ( List dirtyParts , final boolean confirm , final boolean closing , boolean addNonPartSources , final IRunnableContext runnableContext , final IShellProvider shellProvider ) { } private static List convertToSaveables ( List parts , boolean closing , boolean addNonPartSources ) { } private static Saveable [ ] getSaveables ( IWorkbenchPart part ) { } private static boolean closingLastPartShowingModel ( Saveable model , List closingParts , IWorkbenchPage page ) { } public boolean savePart ( final ISaveablePart saveable , IWorkbenchPart part , boolean confirm ) { } public IStatus saveState ( final IMemento memento ) { } public boolean setVisibleEditor ( IEditorReference newEd , boolean setFocus ) { } private IPathEditorInput getPathEditorInput ( IEditorInput input ) { } private class InnerEditor extends EditorReference { private IEditorReference outerEditor ; private AbstractMultiEditor outerEditorPart ; public InnerEditor ( IEditorReference outerEditor , AbstractMultiEditor outerEditorPart , IEditorInput input , EditorDescriptor desc ) { } protected void doDisposePart ( ) { } protected PartPane createPane ( ) { } protected Composite getPaneControlContainer ( ) { } } public void restoreEditorState ( IMemento editorMem , ArrayList visibleEditors , IEditorReference [ ] activeEditor , MultiStatus result ) { } protected void saveEditorState ( IMemento mem , IEditorReference ed , MultiStatus res ) { } public IMemento getMemento ( IEditorReference e ) { } public void removeExtension ( IExtension source , Object [ ] objects ) { } public void addExtension ( IExtensionTracker tracker , IExtension extension ) { } IEditorReference openEmptyTab ( ) { } public static boolean useIPersistableEditor ( ) { } }

Fix:
pinEditorHandlerActivation = handlerService . activateHandler ( WINDOW_PIN_EDITOR , pinEditorHandler , new org . eclipse . ui . ActiveShellExpression ( shell ) ) ;