Buggy code:
public class PerspectiveSwitcher implements IWindowTrim { private IWorkbenchWindow window ; private CBanner topBar ; private int style ; private Composite parent ; private Composite trimControl ; private Label trimSeparator ; private GridData trimLayoutData ; private boolean trimVisible = false ; private int trimOldLength = 0 ; private PerspectiveBarManager perspectiveBar ; private CoolBar perspectiveCoolBar ; private CacheWrapper perspectiveCoolBarWrapper ; private CoolItem coolItem ; private CacheWrapper toolbarWrapper ; private Menu popupMenu ; private Menu genericMenu ; private static final int INITIAL = - 1 ; private static final int TOP_RIGHT = 1 ; private static final int TOP_LEFT = 2 ; private static final int LEFT = 3 ; private static final int DEFAULT_RIGHT_X = 160 ; private int currentLocation = PerspectiveSwitcher . INITIAL ; private IPreferenceStore apiPreferenceStore = PrefUtil . getAPIPreferenceStore ( ) ; private IPropertyChangeListener propertyChangeListener ; private Listener popupListener = new Listener ( ) { public void handleEvent ( Event event ) { } } ; private PerspectiveAdapter perspectiveAdapter = new PerspectiveAdapter ( ) { public void perspectiveOpened ( IWorkbenchPage page , IPerspectiveDescriptor perspective ) { } public void perspectiveClosed ( IWorkbenchPage page , IPerspectiveDescriptor perspective ) { } public void perspectiveActivated ( IWorkbenchPage page , IPerspectiveDescriptor perspective ) { } public void perspectiveDeactivated ( IWorkbenchPage page , IPerspectiveDescriptor perspective ) { } public void perspectiveSavedAs ( IWorkbenchPage page , IPerspectiveDescriptor oldPerspective , IPerspectiveDescriptor newPerspective ) { } } ; private Listener dragListener ; private IDragOverListener dragTarget ; private IDragOverListener externalDragTarget ; private DisposeListener toolBarListener ; private IReorderListener reorderListener ; public PerspectiveSwitcher ( IWorkbenchWindow window , CBanner topBar , int style ) { } private static int convertLocation ( String preference ) { } public void createControl ( Composite parent ) { } private void addPerspectiveShortcut ( IPerspectiveDescriptor perspective , IWorkbenchPage workbenchPage ) { } public IContributionItem findPerspectiveShortcut ( IPerspectiveDescriptor perspective , IWorkbenchPage page ) { } private void removePerspectiveShortcut ( IPerspectiveDescriptor perspective , IWorkbenchPage page ) { } public void setPerspectiveBarLocation ( String preference ) { } private void showPerspectiveBar ( ) { switch ( currentLocation ) { case PerspectiveSwitcher . TOP_LEFT : topBar . setRight ( null ) ; topBar . setBottom ( perspectiveCoolBarWrapper . getControl ( ) ) ; break ; case PerspectiveSwitcher . TOP_RIGHT : topBar . setBottom ( null ) ; topBar . setRight ( perspectiveCoolBarWrapper . getControl ( ) ) ; topBar . setRightWidth ( PerspectiveSwitcher . DEFAULT_RIGHT_X ) ; break ; case PerspectiveSwitcher . LEFT : topBar . setBottom ( null ) ; topBar . setRight ( null ) ; LayoutUtil . resize ( topBar ) ; <START_BUG> ( ( WorkbenchWindow ) ( window ) ) . addToTrim ( this , SWT . LEFT ) ; <END_BUG> break ; default : return ; } LayoutUtil . resize ( perspectiveBar . getControl ( ) ) ; } public void update ( boolean force ) { } private void selectPerspectiveShortcut ( IPerspectiveDescriptor perspective , IWorkbenchPage page , boolean selected ) { } private void updatePerspectiveShortcut ( IPerspectiveDescriptor oldDesc , IPerspectiveDescriptor newDesc , IWorkbenchPage page ) { } public PerspectiveBarManager getPerspectiveBar ( ) { } public void dispose ( ) { } private void disposeChildControls ( ) { } private void createControlForLocation ( int newLocation ) { } private void unhookDragSupport ( ) { } private void hookDragSupport ( ) { } private void setPropertyChangeListener ( ) { } private void createControlForLeft ( ) { } private void createControlForTop ( ) { } private void setCoolItemSize ( final CoolItem coolItem ) { } private void showPerspectiveBarPopup ( Point pt ) { } private boolean selectedPerspectiveIsActive ( Object data ) { } private Menu createPopup ( ToolBar toolBar , boolean isActive ) { } private void addCloseItems ( Menu menu ) { } private PerspectiveBarManager createBarManager ( int direction ) { } private void updateLocationItems ( Menu parent , int newLocation ) { } private void addDockOnSubMenu ( Menu menu ) { } private void addShowTextItem ( Menu menu ) { } private void addCustomizeItem ( Menu menu ) { } private void addSaveAsItem ( Menu menu ) { } private void addResetItem ( Menu menu ) { } public void saveState ( IMemento persBarMem ) { } public void restoreState ( IMemento memento ) { } void updatePerspectiveBar ( ) { } public void updateBarParent ( ) { } public void addReorderListener ( IReorderListener listener ) { } public void dock ( int dropSide ) { } public Control getControl ( ) { } public String getId ( ) { } public String getDisplayName ( ) { } public int getValidSides ( ) { } public boolean isCloseable ( ) { } public void handleClose ( ) { } public int getWidthHint ( ) { } public int getHeightHint ( ) { } public boolean isResizeable ( ) { } }

Fix:
window . getTrimManager ( ) . addTrim ( SWT . LEFT , this ) ;