Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 308317 - Part service is not reinjected with active parts after some time of use
Summary: Part service is not reinjected with active parts after some time of use
Status: RESOLVED FIXED
Alias: None
Product: e4
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 1.0   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: 1.0 M5   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-07 08:21 EDT by Remy Suen CLA
Modified: 2010-04-09 11:25 EDT (History)
1 user (show)

See Also:


Attachments
ESelectionService patch v1 (2.30 KB, patch)
2010-04-08 16:01 EDT, Remy Suen CLA
no flags Details | Diff
Patch (5.02 KB, patch)
2010-04-09 10:17 EDT, Oleg Besedin CLA
no flags Details | Diff
JUnit test (5.87 KB, patch)
2010-04-09 11:25 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 Remy Suen CLA 2010-04-07 08:21:06 EDT
1. Start the compatibility layer.
2. Window > Show View > Properties
3. Select some entries in the 'Package Explorer', the 'Properties' view updates itself correctly.
4. Open a file.
5. Select something in the 'Outline' view, the 'Properties' view updates itself correctly.
6. Close the editor.
7. Select something in the 'Package Explorer'. The 'Properties' view no longer updates itself. Opening editors and selecting things in the 'Outline' view will work. It seems the 'Properties' view has become locked with the 'Outline' view.
Comment 1 Remy Suen CLA 2010-04-07 08:46:47 EDT
Rolling back the fix for bug 308220 didn't help.

Rolling back the fix for bug 308194...is unknown, since the compatibility layer
becomes unusable. :P
Comment 2 Remy Suen CLA 2010-04-07 10:46:41 EDT
The context chain seems correct (unsurprisingly). So it seems the part service has somehow been removed from the list of observers.
Comment 3 Remy Suen CLA 2010-04-08 08:04:41 EDT
This was not a problem with the context code from 0320. I checked out the compatibility layer from HEAD on a 0320 build, modified the manifests to remove the (then) non-existent DI bundles and reorganized my imports, launched, and cannot reproduce the problem.
Comment 4 Remy Suen CLA 2010-04-08 12:46:27 EDT
Looks like you don't have to use an editor. If I just alternative activating between the 'Package Explorer' view, the 'Problems' view, and the 'Outline' view, then close the 'Problems' view, I no longer get part activation notifications.
Comment 5 Remy Suen CLA 2010-04-08 13:44:09 EDT
Looks like SelectionServiceImpl's getSelection() method is the problem here. After cutting out a bunch of code, if I comment the method to just return null, then I cannot reproduce the error.
Comment 6 Remy Suen CLA 2010-04-08 16:01:50 EDT
Created attachment 164280 [details]
ESelectionService patch v1

This patch will workaround the problem.
Comment 7 Remy Suen CLA 2010-04-08 16:05:05 EDT
(In reply to comment #6)
> Created an attachment (id=164280) [details]
> ESelectionService patch v1

Released to HEAD. I am going to leave this bug open for now though.
Comment 8 Oleg Besedin CLA 2010-04-08 16:47:51 EDT
I noticed that when switching between Explorer and Outline views, the PropertySheet#partActivated() is called 6 times on each switch:
 - 2 times with the new part
 - 2 times with the old part
 - 2 times with the new part
Comment 9 Remy Suen CLA 2010-04-08 16:54:03 EDT
(In reply to comment #8)
> I noticed that when switching between Explorer and Outline views, the
> PropertySheet#partActivated() is called 6 times on each switch:
>  - 2 times with the new part
>  - 2 times with the old part
>  - 2 times with the new part

This is with code from HEAD including attachment 164280 [details]?
Comment 10 Remy Suen CLA 2010-04-08 17:02:42 EDT
I only see this happen once with code from HEAD.
Comment 11 Oleg Besedin CLA 2010-04-09 10:17:45 EDT
Created attachment 164377 [details]
Patch

The patch fixes the problem and reverts SelectionService workaround.

The problem was caused by the injection requestors picking extra dependencies when they run in the "update" mode. (That is still a problem and need a change in the way object suppliers communicate with injector; I'll fix that shortly after M5 is declared.) 

In this case a context picked up via such extra dependency was disposed. The "disposal" event was propagated to the injected object which was happily disconnected from the further changes in the injected context.
Comment 12 Oleg Besedin CLA 2010-04-09 10:25:45 EDT
Patch applied to CVS Head. I opened bug 308650 for the extra dependencies problem - it's a bit too big of a change to make on the last day of the milestone; I'll change that shortly after M5 is declared.
Comment 13 Oleg Besedin CLA 2010-04-09 11:25:14 EDT
Created attachment 164391 [details]
JUnit test

Remy made this JUnit to provide an automated test for the UI side. 

Patch applied to CVS Head.