Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 357861

Summary: PartServiceImpl#activate() is called twice on every activation request
Product: [Eclipse Project] Platform Reporter: Oleg Besedin <ob1.eclipse>
Component: UIAssignee: Platform UI Triaged <platform-ui-triaged>
Status: CLOSED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: emoffatt, ob1.eclipse, remy.suen
Version: 4.2   
Target Milestone: 4.3 RC1   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Patch none

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 ***