Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 318460 - [Contributions] [Compatibility] Failed to open error log in I20100629-2126
Summary: [Contributions] [Compatibility] Failed to open error log in I20100629-2126
Status: RESOLVED WORKSFORME
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.1   Edit
Hardware: PC Linux
: P3 major (vote)
Target Milestone: 4.4   Edit
Assignee: Platform UI Triaged CLA
QA Contact: Daniel Rolka CLA
URL:
Whiteboard:
Keywords:
: 317183 318445 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-06-30 09:11 EDT by Paul Webster CLA
Modified: 2014-07-02 04:34 EDT (History)
5 users (show)

See Also:


Attachments
full log, but not much more than what I copied (8.00 KB, text/plain)
2010-06-30 09:11 EDT, Paul Webster CLA
no flags Details
Tests patch to reproduce the problem (5.54 KB, patch)
2010-06-30 14:22 EDT, Remy Suen CLA
no flags Details | Diff
Tests patch to reproduce the problem v2 (6.94 KB, patch)
2010-06-30 14:31 EDT, Remy Suen CLA
no flags Details | Diff
Patch for context injection (3.01 KB, patch)
2010-06-30 15:24 EDT, Oleg Besedin CLA
no flags Details | Diff
Patch for duplicate calls in uninject (933 bytes, patch)
2010-06-30 16:07 EDT, Oleg Besedin CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Webster CLA 2010-06-30 09:11:29 EDT
Created attachment 173092 [details]
full log, but not much more than what I copied

From no deltas, I used quick access to switch the the team sync perspective and then back to java perspective.  Then I used quick access to open the console view, and next when I tried to open the error log I got an NPE.

!ENTRY org.eclipse.e4.ui.workbench 4 0 2010-06-30 09:11:24.160
!MESSAGE Internal Error
!STACK 0
java.lang.NullPointerException
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.activate(PartServiceImpl.java:361)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.showPart(PartServiceImpl.java:577)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.showPart(PartServiceImpl.java:635)
	at org.eclipse.ui.internal.WorkbenchPage.busyShowView(WorkbenchPage.java:678)
	at org.eclipse.ui.internal.WorkbenchPage$7.run(WorkbenchPage.java:2327)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
	at org.eclipse.ui.internal.WorkbenchPage.showView(WorkbenchPage.java:2324)
	at org.eclipse.ui.internal.WorkbenchPage.showView(WorkbenchPage.java:2300)
	at org.eclipse.ui.internal.quickaccess.ViewElement.execute(ViewElement.java:38)
	at org.eclipse.ui.internal.quickaccess.SearchField$1.handleElementSelected(SearchField.java:47)
	at org.eclipse.ui.internal.quickaccess.QuickAccessContents.handleSelection(QuickAccessContents.java:324)
	at org.eclipse.ui.internal.quickaccess.QuickAccessContents.access$0(QuickAccessContents.java:314)
	at org.eclipse.ui.internal.quickaccess.QuickAccessContents$1.keyPressed(QuickAccessContents.java:343)
Comment 1 Paul Webster CLA 2010-06-30 09:14:36 EDT
It failed because it was also opening the views in the team sync perspective.  When I switch back to the team sync perspective, it has both the console and error log views open in it.

PW
Comment 2 Remy Suen CLA 2010-06-30 09:16:04 EDT
Both claims confirmed in my inner.
Comment 3 Remy Suen CLA 2010-06-30 09:28:26 EDT
You don't even need to open the 'Console' view. Just go straight for the 'Error Log' view and the NPE will occur.
Comment 4 Remy Suen CLA 2010-06-30 11:03:55 EDT
For whatever reasons, the workbench window's EPS is not being updated with the 'Java' perspective as its root. Instead, it's still using the previous perspective (in this case, the 'Team Synchronize' one).
Comment 5 Remy Suen CLA 2010-06-30 11:12:09 EDT
The 'Console' view shows up in both perspectives because the 'Java' perspective actually has a placeholder for the 'Console' view.

So the part service first shows the 'Console' view in the (incorrect) 'Team Synchronize' perspective, then farther down in the code, we try to activate the 'Console' view in the 'Java' perspective. Since a placeholder is actually there, it is found and that operation completes successfully.

There are no placeholders for the 'Error Log' in the 'Java' perspective so we get an NPE back for our troubles.
Comment 6 Eric Moffatt CLA 2010-06-30 13:49:44 EDT
This is apparently caused (somehow) by the 'uninject' code introduced to the PartRenderingEngine yesterday. At least commenting the code out seems to resolve some number of the issues.

My best guess is that the un-inject is executing some computation (specifically the context function that sets the 'rootContainer' for the window's context) in a manner that causes it to not 'get' any context values. Remy has observed that after the first context switch it never seems to fire for the *window* even though other ones correctly update the 'rootContainer' on a perspective switch.
Comment 7 Eric Moffatt CLA 2010-06-30 13:55:21 EDT
Oleg, where's the code that will remove a 'stale' computation? I'd like to see whether or not my comments reflect any sort of reality...;-).
Comment 8 Eric Moffatt CLA 2010-06-30 14:04:45 EDT
Committed in >20100630. I've commented out the call to 'uninject' in the PartRenderingEngine#removeGui for now since it seems to solve at least this (and perhaps other) issues.

Once the 'uninject' code is fixed we should un-comment the code in the PRE (otherwise I expect that we will have multiple PerspectiveSwitcher listeners firing against ones that have been removed...
Comment 9 Remy Suen CLA 2010-06-30 14:22:13 EDT
Created attachment 173139 [details]
Tests patch to reproduce the problem

Having problems trimming this down further but this will do I suppose.
Comment 10 Eric Moffatt CLA 2010-06-30 14:23:04 EDT
Committed in >20100630. I've hacked the PerspectiveSwitcher to remove its subscribed listeners on the 'comp' widget being disposed as opposed to relying on @PreDestroy. This should be safe since 'unsubscribe' is a no-op if the listener hasn't been registered so calling it twice isn't an issue. Without this we would likely run into issues with 'stale' switchers attempting to react to events after they've been removed from the UI.
Comment 11 Remy Suen CLA 2010-06-30 14:31:38 EDT
Created attachment 173140 [details]
Tests patch to reproduce the problem v2

This includes the original test from the previous attachment and a more condensed version.
Comment 12 Oleg Besedin CLA 2010-06-30 15:24:42 EDT
Created attachment 173149 [details]
Patch for context injection

Patch fixes JUnits.

(Patch for the context injection applied to CVS Head.)
Comment 13 Oleg Besedin CLA 2010-06-30 15:26:46 EDT
*** Bug 317183 has been marked as a duplicate of this bug. ***
Comment 14 Oleg Besedin CLA 2010-06-30 16:07:43 EDT
Created attachment 173154 [details]
Patch for duplicate calls in uninject

This also uncovered duplicate calls in #uninject(). 

(Patch applied to CVS Head.)
Comment 15 Remy Suen CLA 2010-06-30 19:47:13 EDT
*** Bug 318445 has been marked as a duplicate of this bug. ***
Comment 16 Dani Megert CLA 2010-07-02 09:16:56 EDT
Using SDK 4.0 - I20100701-1105 my issue (bug 317183) which was marked as dup of this one seems almost fixed: there's still 'Last Edit Location' which is enabled out of the box but shouldn't.
Comment 17 Lars Vogel CLA 2014-07-02 04:34:49 EDT
(In reply to Paul Webster from comment #0)
> Created attachment 173092 [details]
> full log, but not much more than what I copied
> 
> From no deltas, I used quick access to switch the the team sync perspective
> and then back to java perspective.  Then I used quick access to open the
> console view, and next when I tried to open the error log I got an NPE.

Works for me in Luna. Marking as WORKSFORME