Bug 336139 NPE thrown when trying to render a trim with unidentified elements
java.lang.NullPointerException at org.eclipse.e4.ui.workbench.renderers.swt.TrimBarLayout.isStatusLine(TrimBarLayout.java:245) at org.eclipse.e4.ui.workbench.renderers.swt.TrimBarLayout.computeSize(TrimBarLayout.java:146) at org.eclipse.e4.ui.workbench.renderers.swt.TrimBarLayout.access$0(TrimBarLayout.java:142) at org.eclipse.e4.ui.workbench.renderers.swt.TrimBarLayout$TrimLine.addControl(TrimBarLayout.java:36) at org.eclipse.e4.ui.workbench.renderers.swt.TrimBarLayout.computeSize(TrimBarLayout.java:104) at org.eclipse.swt.widgets.Composite.computeSize(Composite.java:233) at org.eclipse.e4.ui.workbench.renderers.swt.TrimmedPartLayout.layout(TrimmedPartLayout.java:120) at org.eclipse.swt.widgets.Composite.updateLayout(Composite.java:1263) at org.eclipse.swt.widgets.Composite.updateLayout(Composite.java:1249) at org.eclipse.swt.widgets.Composite.layout(Composite.java:664) at org.eclipse.swt.widgets.Composite.layout(Composite.java:622) at org.eclipse.e4.ui.workbench.renderers.swt.WBWRenderer.postProcess(WBWRenderer.java:585)
tests/org.eclipse.e4.ui.tests/src/org/eclipse/e4/ui/tests/workbench/PartRenderingEngineTests.java
MPerspective perspectiveB = AdvancedFactoryImpl.eINSTANCE
				.createPerspective();
		perspectiveStack.getChildren().add(perspectiveB);
		MPlaceholder partStackPlaceholderB = AdvancedFactoryImpl.eINSTANCE
				.createPlaceholder();
		partStackPlaceholderB.setRef(partStack);
		perspectiveB.getChildren().add(partStackPlaceholderB);
		perspectiveB.setSelectedElement(partStackPlaceholderB);
		MPart part1 = BasicFactoryImpl.eINSTANCE.createPart();
		part1.setContributionURI("platform:/plugin/org.eclipse.e4.ui.tests/org.eclipse.e4.ui.tests.workbench.SampleView");
		partStack.getChildren().add(part1);
		partStack.setSelectedElement(part1);
		MPart part2 = BasicFactoryImpl.eINSTANCE.createPart();
		part2.setContributionURI("platform:/plugin/org.eclipse.e4.ui.tests/org.eclipse.e4.ui.tests.workbench.SampleView");
		partStack.getChildren().add(part2);
		application.setContext(appContext);
		appContext.set(MApplication.class.getName(), application);
		wb = new E4Workbench(application, appContext);
		wb.createAndRunUI(window);
		EPartService partService = window.getContext().get(EPartService.class);
		partService.activate(part1);
		partService.activate(part2);
		partService.activate(part1);
		partService.switchPerspective(perspectiveB);
		partService.switchPerspective(perspectiveA);
		SampleView view1 = (SampleView) part1.getObject();
		SampleView view2 = (SampleView) part2.getObject();
		appContext.get(IPresentationEngine.class).removeGui(window);
		assertFalse(view1.nullParentContext);
		assertFalse(view2.nullParentContext);