Bug 329184 Detached view that is an activation target candidate can prevent perspective switching
1. Detach the 'Outline' view. 2. Window > Open Perspective > Debug 3. Window > Open Perspective > Java 4. The perspective switch doesn't actually happen. You see the 'Debug' perspective's content with an 'Outline' view detached. Closing the 'Outline' view in the 'Debug' perspective will workaround this problem.
tests/org.eclipse.e4.ui.tests/src/org/eclipse/e4/ui/tests/application/EPartServiceTest.java
window.getChildren().add(partStack);
			for (int j = 0; j < partIds[i].length; j++) {
				MPart part = BasicFactoryImpl.eINSTANCE.createPart();
				part.setElementId(partIds[i][j]);
				partStack.getChildren().add(part);
			}
		}
		initialize(applicationContext, application);
		return application;
	}
	private void initialize(IEclipseContext applicationContext,
			MApplication application) {
		application.setContext(applicationContext);
		applicationContext.set(MApplication.class.getName(), application);
		E4Workbench.processHierarchy(application);
		((Notifier) application).eAdapters().add(
				new UIEventPublisher(applicationContext));
		applicationContext.set(ISaveHandler.class.getName(),
				new ISaveHandler() {
					public Save[] promptToSave(Collection<MPart> saveablePart) {
						Save[] ret = new Save[saveablePart.size()];
						Arrays.fill(ret, ISaveHandler.Save.YES);
						return ret;
					}
					public Save promptToSave(MPart saveablePart) {
						return ISaveHandler.Save.YES;
					}
				});
	}
	class PartListener implements IPartListener {