Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 327012 - Investigate initializing JavaScriptDebugTarget explicitly
Summary: Investigate initializing JavaScriptDebugTarget explicitly
Status: NEW
Alias: None
Product: JSDT
Classification: WebTools
Component: Debug (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Simon Kaegi CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-05 10:11 EDT by Michael Rennie CLA
Modified: 2010-10-05 15:39 EDT (History)
3 users (show)

See Also:


Attachments

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