Community
Participate
Working Groups
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)
Since we have another part lying around in the stack, we actually don't unset the stack's selected element when the editor is closed in step 4 so this part actually ends up being leaked until the selected element changes. This leaked part causes problems later down the road when we try to query it for its parent context. Will need to figure out if there are alternate code paths that will lead to this problem besides the one described above.
(In reply to comment #1) > Since we have another part lying around in the stack, we actually don't unset > the stack's selected element when the editor is closed in step 4 so this part > actually ends up being leaked until the selected element changes. Fixed in CVS HEAD. > This leaked part causes problems later down the road when we try to query it > for its parent context. Will need to figure out if there are alternate code > paths that will lead to this problem besides the one described above. This seems to only happen if we have a stack with a selected element that's not actually a children of the stack. This is an invalid model state so having the code error out doesn't seem out of the ordinary to me. I will leave this code alone.
Verified on Windows XP with I20101025-1602.