Bug 305182 - [breakpoints] Refactoring a method/field with associated breakpoint changes working set
Summary: [breakpoints] Refactoring a method/field with associated breakpoint changes w...
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 3.6   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 4.4 M6   Edit
Assignee: Sarika Sinha CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2010-03-09 11:26 EST by Darin Wright CLA
Modified: 2014-04-03 07:56 EDT (History)
3 users (show)

See Also:
Michael_Rennie: review+


Attachments
Preserving the working set (3.40 KB, application/octet-stream)
2014-02-25 04:25 EST, Sarika Sinha CLA
no flags Details
Preserving the working set at BreakpointChange level (11.68 KB, patch)
2014-02-26 05:06 EST, Sarika Sinha CLA
Michael_Rennie: review+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Darin Wright CLA 2010-03-09 11:26:17 EST
Using I20100309-0100

* Create breakpoint working sets A and B
* Make working set A default
* Create a method entry breakpoint (appears in A)
* Make working set B default
* refactor the method name where the breakpoint is
* The breakpoint will move to working set B after being refactored

If there is no default working set, it will move to the "Other" category. Looks like the newly created breakpoint gets the current "defaut working set" applied to it rather than retaining its original working set. Same happens for refactored watch points.
Comment 1 Sarika Sinha CLA 2014-02-25 04:25:09 EST
Created attachment 240290 [details]
Preserving the working set

This patch preserves  the Working set for the new breakpoint created after method/watchpoint  refactor. Refactoring causes the deletion of original breakpoint and creation of new breakpoint with original attributes.
Comment 2 Michael Rennie CLA 2014-02-25 08:34:19 EST
The patch works great for method entry/exit and watchpoints, but does not work for class load breakpoints:

1. create two working sets A and B - set A as the default
2. using the following snippet set breakpoints where indicated:

public class Clazz { //class load
	
	int field = 10; //watchpoint
	
	void method() {} //method breakpoint
}

3. set all the breakpoints in working set B (non-default)
4. rename Clazz to Clazz2 - notice that *all* breapoints are moved to the default working set.
Comment 3 Sarika Sinha CLA 2014-02-26 05:06:24 EST
Created attachment 240322 [details]
Preserving the working set at BreakpointChange level

This patch preserves the working set for Line, Field, Method and Class breakpoints during refactor. Original Working set is stored at Breakpoint change level as Class refactor can knock off the original marker attributes.
Comment 4 Michael Rennie CLA 2014-02-26 11:26:38 EST
Works perfectly now.

Pushed to: http://git.eclipse.org/c/jdt/eclipse.jdt.debug.git/commit/?id=0bfc63099d16d40e4ca4fcb5a1e013da07febc8b

Thanks Sarika.
Comment 5 Sarika Sinha CLA 2014-03-04 02:49:14 EST
Verified with 
Version: Luna (4.4)
Build id: I20140303-2000