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

Bug 347119

Summary: [Compatibility] Application context is notified that the application has started twice
Product: [Eclipse Project] e4 Reporter: Dani Megert <daniel_megert>
Component: UIAssignee: Remy Suen <remy.suen>
Status: VERIFIED FIXED QA Contact: Remy Suen <remy.suen>
Severity: major    
Priority: P3 CC: emoffatt, Mike_Wilson, pwebster, remy.suen
Version: 1.0   
Target Milestone: 4.1 RC3   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Workbench patch v1 none

Description Dani Megert CLA 2011-05-25 04:56:33 EDT
I20110522-2200 (4.1).

When I start Eclipse with -debug I get this in the console:

Time to load bundles: 203
Starting application: 33751
Application Started: 43470
Application Started: 52439


This looks fishy: is the application is started twice?
Comment 1 Remy Suen CLA 2011-05-25 08:15:39 EDT
(In reply to comment #0)
> This looks fishy: is the application is started twice?

EclipseAppHandle's applicationRunning() is being called twice so there are two notifications being called to DefaultStartMonitor.

Thread [main] (Suspended)	
	DefaultStartupMonitor.applicationRunning() line: 60	
	EclipseAppHandle$1.run() line: 268	
	SafeRunner.run(ISafeRunnable) line: 42	
	EclipseAppHandle.applicationRunning() line: 258	
	InternalPlatform.endSplash() line: 154	
	Platform.endSplash() line: 567	
	Workbench.runUI() line: 2460	
	Workbench.access$3(Workbench) line: 2345	
	Workbench$3.run() line: 540	
	Realm.runWithDefault(Realm, Runnable) line: 332	
	Workbench.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 522

Thread [main] (Suspended)	
	DefaultStartupMonitor.applicationRunning() line: 60	
	EclipseAppHandle$1.run() line: 268	
	SafeRunner.run(ISafeRunnable) line: 42	
	EclipseAppHandle.applicationRunning() line: 258	
	PartRenderingEngine$9.run() line: 919	
	Realm.runWithDefault(Realm, Runnable) line: 332	
	PartRenderingEngine.run(MApplicationElement, IEclipseContext) line: 860	
	E4Workbench.createAndRunUI(MApplicationElement) line: 87	
	Workbench$3.run() line: 542	
	Realm.runWithDefault(Realm, Runnable) line: 332	
	Workbench.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 522
Comment 2 Remy Suen CLA 2011-05-25 08:23:40 EDT
We could fix the problem by just deleting the Platform.endSplash() call in Workbench's runUI() method. The method is deprecated and is supposed to be replaced by IApplicationContext's applicationRunning() method anyway and we call that method when the Eclipse 4 renderer has completed rendering the application.

It would also fix bug 320021.
Comment 3 Remy Suen CLA 2011-05-25 09:35:32 EDT
Created attachment 196551 [details]
Workbench patch v1

Patch to remove the Platform.endSplash() call from Workbench's runUI() method.
Comment 4 Remy Suen CLA 2011-05-25 09:36:50 EDT
(In reply to comment #3)
> Created attachment 196551 [details]
> Workbench patch v1

Patch released to CVS HEAD.

Thanks for the bug report, Dani.
Comment 5 Dani Megert CLA 2011-06-06 04:25:26 EDT
Verified in I20110604-2201.