This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
When I edit code with breakpoint, there is some strange behavior: 1) when I delete the line with the breakpoint, the breakpoint should be deleted as well. But it remains there, on the line number, which it was tied with. If I delete more lines (selection), the breakpoint is on the first line of the selected block. 2) when I delete the line just before the breakpoint and then undo this operation, the bvreakpoint is now not on the line it was before, but on the previous one. 3) same situation is with pasting: when I paste some code (more lines) with cursor on the line with breakpoint, it „moves“ (it remains on the line with original number, but its right line was moved down) 4) Pressing enter at the beginning of the line with breakpoint moves the code, but not the breakpoint. 5) Breakpoints window isnt updated during these operations and the line numbers it shows arent correct
This should be repaired into 4.2.
This is a defect actually, not an enhancement... ;-)
This concerns line breakpoints only. The line number information needs to be updated after every change. Just the JDI breakpoint need to keep the original line number and the shifted lines must be translated during stepping. This translation needs to be reset after application of code changes.
After issue #63595 was fixed, this becomes more visible. Starting to work on this...
The updating of line breakpoints is completely rewritten. It should work as expected now. I did not implement (1) though - delete the breakpoint when line is deleted. The breakpoint is moved to the preceding line instead, it can be easily removed if really needed. /shared/data/ccvs/repository/debuggerjpda/src/org/netbeans/modules/debugger/jpda/JPDADebuggerImpl.java,v <-- JPDADebuggerImpl.java new revision: 1.128; previous revision: 1.127 /shared/data/ccvs/repository/debuggerjpda/src/org/netbeans/modules/debugger/jpda/breakpoints/LineBreakpointImpl.java,v <-- LineBreakpointImpl.java new revision: 1.41; previous revision: 1.40 /shared/data/ccvs/repository/debuggerjpda/projects/src/org/netbeans/modules/debugger/jpda/projects/BreakpointAnnotationProvider.java,v <-- BreakpointAnnotationProvider.java new revision: 1.3; previous revision: 1.2 /shared/data/ccvs/repository/debuggerjpda/projects/src/org/netbeans/modules/debugger/jpda/projects/EditorContextImpl.java,v <-- EditorContextImpl.java new revision: 1.32; previous revision: 1.31 RCS file: /shared/data/ccvs/repository/debuggerjpda/projects/src/org/netbeans/modules/debugger/jpda/projects/LineTranslations.java,v /shared/data/ccvs/repository/debuggerjpda/projects/src/org/netbeans/modules/debugger/jpda/projects/LineTranslations.java,v <-- LineTranslations.java initial revision: 1.1 /shared/data/ccvs/repository/debuggerjpda/ui/src/META-INF/debugger/org.netbeans.api.debugger.LazyDebuggerManagerListener,v <-- org.netbeans.api.debugger.LazyDebuggerManagerListener new revision: 1.7; previous revision: 1.6 Removing ui/src/META-INF/debugger/org.netbeans.modules.debugger.jpda.ui.breakpoints.BreakpointAnnotationListener; /shared/data/ccvs/repository/debuggerjpda/ui/src/META-INF/debugger/org.netbeans.modules.debugger.jpda.ui.breakpoints.BreakpointAnnotationListener,v <-- org.netbeans.modules.debugger.jpda.ui.breakpoints.BreakpointAnnotationListener new revision: delete; previous revision: 1.1 /shared/data/ccvs/repository/debuggerjpda/ui/src/META-INF/debugger/netbeans-JPDASession/Java/org.netbeans.api.debugger.LazyActionsManagerListener,v <-- org.netbeans.api.debugger.LazyActionsManagerListener new revision: 1.4; previous revision: 1.3 /shared/data/ccvs/repository/debuggerjpda/ui/src/org/netbeans/modules/debugger/jpda/ui/actions/ToggleBreakpointActionProvider.java,v <-- ToggleBreakpointActionProvider.java new revision: 1.16; previous revision: 1.15 /shared/data/ccvs/repository/debuggerjpda/ui/src/org/netbeans/modules/debugger/jpda/ui/actions/ToggleMethodFieldBreakpointAction.java,v <-- ToggleMethodFieldBreakpointAction.java new revision: 1.7; previous revision: 1.6 Removing ui/src/org/netbeans/modules/debugger/jpda/ui/breakpoints/BreakpointAnnotationListener.java; /shared/data/ccvs/repository/debuggerjpda/ui/src/org/netbeans/modules/debugger/jpda/ui/breakpoints/BreakpointAnnotationListener.java,v <-- BreakpointAnnotationListener.java new revision: delete; previous revision: 1.12 Removing ui/src/org/netbeans/modules/debugger/jpda/ui/breakpoints/BreakpointsUpdater.java; /shared/data/ccvs/repository/debuggerjpda/ui/src/org/netbeans/modules/debugger/jpda/ui/breakpoints/BreakpointsUpdater.java,v <-- BreakpointsUpdater.java new revision: delete; previous revision: 1.4
Verified ... and Closing all issues resolved into NetBeans 6.7 and earlier.