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

Bug 348374

Summary: Debug breakpoints get stale on editing code
Product: [Eclipse Project] JDT Reporter: Ayushman Jain <amj87.iitr>
Component: DebugAssignee: JDT-Debug-Inbox <jdt-debug-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: Michael_Rennie, sarika.sinha
Version: 3.7   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Ayushman Jain CLA 2011-06-06 05:51:38 EDT
Build id:3.7RC4

package p;
public class Bug {
    void foo(String name) {
        try { 
        }
        
        if (true) {
        	System.out.println();     // Put breakpoint here
        } else {
        	System.out.println();
        }
       
    }
}

Put the breakpoint at line 7. Now edit the try block so that the code looks like this
public class Bug {
    void foo(String name) {
        try { 
	        System.out.println();
        	int abc = 1;
        }
        
        if (true) {
        	System.out.println();     // Breakpoint stays on this line
        } else {
        	System.out.println();
        }
       
    }
}

Note that the breakpoint moves down 2 lines i.e. at line 9 and stays along with the System.out.println();, but its just a stale marker. Looking at the breakpoints view, you see that a breakpoint on line 7. Trying to remove the stale breakpoint at line 9 by double clicking the blue dot fails, but adds a fresh breakpoint instead (see breakpoints view). 

Such a scenario can also occur when i delete some code and the breakpoint moves a few lines up/down. I always have to manually delete the stale breakpoint in the breakpoints view.
Comment 1 Michael Rennie CLA 2011-06-06 10:02:34 EDT
This problem is caused by our marker updater not working as expected (bug 330878).

*** This bug has been marked as a duplicate of bug 330878 ***
Comment 2 Sarika Sinha CLA 2014-06-23 01:44:58 EDT
Works fine with Luna RC4 build.
Comment 3 Sarika Sinha CLA 2014-06-30 02:37:02 EDT
(In reply to Sarika Sinha from comment #2)
> Works fine with Luna RC4 build.

My mistake in understanding the problem. It works fine only after the save. It should refresh the Breakpoint view without save as well.