Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 357861 - PartServiceImpl#activate() is called twice on every activation request
Summary: PartServiceImpl#activate() is called twice on every activation request
Status: CLOSED DUPLICATE of bug 402073
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.2   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 4.3 RC1   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-15 14:56 EDT by Oleg Besedin CLA
Modified: 2013-05-14 11:24 EDT (History)
3 users (show)

See Also:


Attachments
Patch (804 bytes, patch)
2011-09-15 15:04 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 Oleg Besedin CLA 2011-09-15 14:56:44 EDT
The PartServiceImpl#activate() calls itself recursively on every activation request by setting focus to the part being activated before activation is finished.

Removing extra processing by making @Focus call to be the last improves performance of open/close view tests by about 20%.
Comment 1 Oleg Besedin CLA 2011-09-15 15:04:28 EDT
Created attachment 203438 [details]
Patch
Comment 2 Remy Suen CLA 2011-09-21 08:54:42 EDT
Oleg, I noticed you released this patch.
http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?h=R4_development&id=d7c903bb8a6f67818a592cec13b61db013d83820

Should we close this bug?
Comment 3 Oleg Besedin CLA 2011-09-21 09:17:33 EDT
Yes, thank you.
Comment 4 Oleg Besedin CLA 2011-10-27 10:56:04 EDT
While the patch removed the "expensive" part of the processing, the PartServiceImpl#activate() is still called twice. 

It seems that the nested calls to 
	partActivationHistory.prepend(part);
	UIEvents.publishEvent(UIEvents.UILifeCycle.ACTIVATE, part);

are required to set up parent contexts to properly register the part as being active.
Comment 5 Eric Moffatt CLA 2013-05-14 11:24:32 EDT
This has also been fixed by the code added for bug 402073...

*** This bug has been marked as a duplicate of bug 402073 ***