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

Bug 327012

Summary: Investigate initializing JavaScriptDebugTarget explicitly
Product: [WebTools] JSDT Reporter: Michael Rennie <Michael_Rennie>
Component: DebugAssignee: Project Inbox <jsdt.debug-inbox>
Status: NEW --- QA Contact: Simon Kaegi <simon_kaegi>
Severity: normal    
Priority: P3 CC: browe, johnjbarton, thatnitind
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Michael Rennie CLA 2010-10-05 10:11:23 EDT
code fro HEAD

Currently when you create a debug target all of the initialization of the target is done in the constructor, which can be a good amount of work.

We should look into performing all of the initialization outside of the constructor - perhaps in an explicit call to initialize() or start().
Comment 1 John J. Barton CLA 2010-10-05 14:10:38 EDT
I was looking at this issue and realized there is another solution.

If you derive a class FooDebugTarget from JavaScriptDebugTarget then override initialize():

	public synchronized void initialize() {
		// delay these operations
	}


	public synchronized void completeInitiailize() {
		super.initialize();
	}

then you can change or delay the call to the base class initialize(). In my case this was needed because my eventRequestManager wants to know the debug target, but the initialize() call uses the eventRequestManager. By creating the DebugTarget, then calling the completeInitialize() the eventRequestManager can be properly set up.

This may well be an adequate solution for this issue.
Comment 2 Michael Rennie CLA 2010-10-05 15:39:33 EDT
(In reply to comment #1)
> 
> This may well be an adequate solution for this issue.

It is a good place to start. Although I still think there could be value in delaying the initialization in general so that other clients would not have to create their own target sub-classes.