Bug 327026 [Compatibility] NPE thrown when reopening an editor after moving a view into the shared area
1. Open an editor. 2. Move the 'Problems' view into the shared area. 3. Close the 'Problems' view. 4. Close the editor. 5. Reopen the same file from step 1. 6. An NPE is thrown. java.lang.NullPointerException at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.getParentWithContext(PartServiceImpl.java:224) at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.internalFixContext(PartServiceImpl.java:272) at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.bringToTop(PartServiceImpl.java:248) at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.showPart(PartServiceImpl.java:742) at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.showPart(PartServiceImpl.java:795) at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2206) at org.eclipse.ui.internal.WorkbenchPage.access$14(WorkbenchPage.java:2173) at org.eclipse.ui.internal.WorkbenchPage$6.run(WorkbenchPage.java:2155) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2151) at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2135) at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2126) at org.eclipse.ui.ide.IDE.openEditor(IDE.java:651) at org.eclipse.ui.ide.IDE.openEditor(IDE.java:610) at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:354) at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:164) at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:219)
tests/org.eclipse.e4.ui.tests/src/org/eclipse/e4/ui/tests/application/EPartServiceTest.java
assertEquals(part, partsA.get(0));
		List<MPlaceholder> placeholdersA = modelService.findElements(
				perspectiveA, part.getElementId(), MPlaceholder.class, null);
		assertEquals(1, placeholdersA.size());
		assertEquals(part.getCurSharedRef(), placeholdersA.get(0));
		assertEquals(part, placeholdersA.get(0).getRef());
		List<MPart> partsB = modelService.findElements(perspectiveB,
				part.getElementId(), MPart.class, null);
		assertEquals(0, partsB.size());
		List<MPlaceholder> placeholdersB = modelService.findElements(
				perspectiveB, part.getElementId(), MPlaceholder.class, null);
		assertEquals(0, placeholdersB.size());
		perspectiveStack.setSelectedElement(perspectiveB);
		window.getContext().set(IContextConstants.ACTIVE_CHILD,
				perspectiveB.getContext());
		partService.showPart(part, PartState.ACTIVATE);
		partsA = modelService.findElements(perspectiveA, part.getElementId(),
				MPart.class, null);
		assertEquals(1, partsA.size());
		assertEquals(part, partsA.get(0));
		placeholdersA = modelService.findElements(perspectiveA,
				part.getElementId(), MPlaceholder.class, null);
		assertEquals(1, placeholdersA.size());
		assertEquals(part, placeholdersA.get(0).getRef());
		partsB = modelService.findElements(perspectiveB, part.getElementId(),
				MPart.class, null);
		assertEquals(1, partsB.size());
		assertEquals(part, partsB.get(0));
		placeholdersB = modelService.findElements(perspectiveB,
				part.getElementId(), MPlaceholder.class, null);