Project: Eclipse_Platform_UI
Bug 307128 [Compatibility] NPE thrown when rerendering a 3.x view that no longer has tool items
Reported: 2010-03-25 15:52:49 | Status: resolved fixed

The basic gist of the problem is that a 3.x view's toolbar may be tagged with "LegacyTB" when it's constructed. There is an assumption here that the part's control has the JFace IToolBarManager set in it. However, this is only set if the toolbar actually has items. It may have had items in the beginning but not anymore in the reset. Hence, when the renderer tries to ask the part's control for the ITBM, null is returned. java.lang.NullPointerException at org.eclipse.e4.workbench.ui.renderers.swt.ToolBarRenderer.createWidget(ToolBarRenderer.java:53) at org.eclipse.e4.ui.workbench.swt.internal.PartRenderingEngine.createWidget(PartRenderingEngine.java:444) at org.eclipse.e4.ui.workbench.swt.internal.PartRenderingEngine.createGui(PartRenderingEngine.java:342) at org.eclipse.e4.workbench.ui.renderers.swt.StackRenderer.getToolbar(StackRenderer.java:509) at org.eclipse.e4.workbench.ui.renderers.swt.StackRenderer.showTab(StackRenderer.java:466) at org.eclipse.e4.workbench.ui.renderers.swt.LazyStackRenderer.postProcess(LazyStackRenderer.java:98) at org.eclipse.e4.ui.workbench.swt.internal.PartRenderingEngine.createGui(PartRenderingEngine.java:358) at org.eclipse.e4.ui.workbench.swt.internal.PartRenderingEngine.createGui(PartRenderingEngine.java:404) at org.eclipse.e4.workbench.ui.renderers.swt.SWTPartRenderer.processContents(SWTPartRenderer.java:56) at org.eclipse.e4.ui.workbench.swt.internal.PartRenderingEngine.createGui(PartRenderingEngine.java:354) at org.eclipse.e4.ui.workbench.swt.internal.PartRenderingEngine.createGui(PartRenderingEngine.java:404) at org.eclipse.e4.workbench.ui.renderers.swt.SWTPartRenderer.processContents(SWTPartRenderer.java:56) at org.eclipse.e4.ui.workbench.swt.internal.PartRenderingEngine.createGui(PartRenderingEngine.java:354) at org.eclipse.e4.ui.workbench.swt.internal.PartRenderingEngine.createGui(PartRenderingEngine.java:404) at org.eclipse.e4.workbench.ui.renderers.swt.SWTPartRenderer.processContents(SWTPartRenderer.java:56) at org.eclipse.e4.ui.workbench.swt.internal.PartRenderingEngine.createGui(PartRenderingEngine.java:354) at org.eclipse.e4.ui.workbench.swt.internal.PartRenderingEngine.createGui(PartRenderingEngine.java:404) at org.eclipse.e4.workbench.ui.renderers.swt.SWTPartRenderer.processContents(SWTPartRenderer.java:56) at org.eclipse.e4.ui.workbench.swt.internal.PartRenderingEngine.createGui(PartRenderingEngine.java:354) at org.eclipse.e4.ui.workbench.swt.internal.PartRenderingEngine.createGui(PartRenderingEngine.java:404) at org.eclipse.e4.workbench.ui.renderers.swt.PerspectiveStackRenderer.showTab(PerspectiveStackRenderer.java:100) at org.eclipse.e4.workbench.ui.renderers.swt.LazyStackRenderer.postProcess(LazyStackRenderer.java:98) at org.eclipse.e4.workbench.ui.renderers.swt.PerspectiveStackRenderer.postProcess(PerspectiveStackRenderer.java:74) at org.eclipse.e4.ui.workbench.swt.internal.PartRenderingEngine.createGui(PartRenderingEngine.java:358) at org.eclipse.e4.ui.workbench.swt.internal.PartRenderingEngine.createGui(PartRenderingEngine.java:404) at org.eclipse.e4.workbench.ui.renderers.swt.SWTPartRenderer.processContents(SWTPartRenderer.java:56) at org.eclipse.e4.workbench.ui.renderers.swt.WBWRenderer.processContents(WBWRenderer.java:399) at org.eclipse.e4.ui.workbench.swt.internal.PartRenderingEngine.createGui(PartRenderingEngine.java:354) at org.eclipse.e4.ui.workbench.swt.internal.PartRenderingEngine.createGui(PartRenderingEngine.java:404) at org.eclipse.e4.ui.workbench.swt.internal.PartRenderingEngine$5.run(PartRenderingEngine.java:535) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.e4.ui.workbench.swt.internal.PartRenderingEngine.run(PartRenderingEngine.java:484) at org.eclipse.e4.workbench.ui.internal.E4Workbench.createAndRunUI(E4Workbench.java:100) at org.eclipse.ui.internal.Workbench$3.run(Workbench.java:526) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)

Files changed in fix:
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/e4/compatibility/CompatibilityView.java