Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 347119 - [Compatibility] Application context is notified that the application has started twice
Summary: [Compatibility] Application context is notified that the application has star...
Status: VERIFIED FIXED
Alias: None
Product: e4
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 1.0   Edit
Hardware: All All
: P3 major (vote)
Target Milestone: 4.1 RC3   Edit
Assignee: Remy Suen CLA
QA Contact: Remy Suen CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-25 04:56 EDT by Dani Megert CLA
Modified: 2011-06-06 04:25 EDT (History)
4 users (show)

See Also:


Attachments
Workbench patch v1 (782 bytes, patch)
2011-05-25 09:35 EDT, Remy Suen CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.