| Summary: | InjectionException via NPE when starting a workspace with no perspective opened | ||
|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Dean Roberts <dean.t.roberts> |
| Component: | UI | Assignee: | Dean Roberts <dean.t.roberts> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | emoffatt, pwebster, remy.suen |
| Version: | 4.2 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows 7 | ||
| Whiteboard: | |||
|
Description
Dean Roberts
When StandardTrim.createStatusLine() is called in the error case, the EclipseContext for the toolControl does not contain an IWorkbenchWindow. While it would be trivial to do a null check, I'm not sure if this is just the symptom of a start up ordering problem? The workbench window is being set in the context by WorkbenchWindow.setup(). But in the error case StandardTrim.createStatusLine() is called BEFORE WorkbnehcWindow.setup(). In a regular start up sequence, WorkbenchWindow.setup() is being called before StandardTrim.createStatusLine() so everything works. In both cases, the startup sequence seems to be determined by PartRenderingEngine.createGui(MUIElement, Object, IEclipseContext) ... but I have not had much luck figuring out how this is intended to work. I guess the question is, is this a start up ordering problem that needs to be fixed, or is it reasonable that the context may not have a workbench window set? (In reply to comment #1) > When StandardTrim.createStatusLine() is called in the error case, the > EclipseContext for the toolControl does not contain an IWorkbenchWindow. Ideally we should support the three controls that the current StandardTrim provides (progress bar, heap status, and a status line) in Eclipse 4. Also see bug 332499. > I guess the question is, is this a start up ordering problem that needs to be > fixed, or is it reasonable that the context may not have a workbench window > set? There's probably a startup ordering problem hidden in here but we should try to refactor those trim controls so that they don't need an IWorkbenchWindow to operate. A new Exception in this test case has been introduced, I believe by the work done in Bug 340695. It looks like it is caused for the same reasons. The Exception is an ArrayIndexOutOfBounds exception in ToolControlRenderer.createWidget() Fixed the NPE using the expedient Null check. I believe modeling the progress bar, status line and heap size indicator will have to wait for a future release. There is already a defect opened for this as noted in comment #2. http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=6f4d44ec72636119320edd56e5495a5a05af4ed4 As noted in comment #3 there is now an ArrayIndexOutOfBoundsException that was introduced by work on trim dragging. Since the cause seems slightly more involved than this one, and the trim drag work is ongoing, I have annotated that defect and will close this one. |