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.
People are often confused that they add a breakpoint on some (empty) line and the debugger stops at another (the first non-empty) line. It would be good if actions for adding line breakpoints (Toggle Breakpoint, Add Breakpoint) would warn before adding a breakpoint on an empty line. Proposal - draft: 1) Toggle Breakpoint--------------------When a user invokes action on an empty line, a dialog appears allowing to choose between two options: ooo Put the breakpoint on another line Line number: [xxx] (where 'xxx' is number of the first non-empty line below the current line) ooo Cancel 2) Add breakpoint dialog ------------------------ When adding breakpoint via the "Add Breakpoint" dialog, the source code may not be available. a) The source code is available i) Source editor was selected at the time the "Add Breakpoint" action was invoked. The dialog contains pre-filled values for Package, Class and Line Number of the breakpoint. If the editor cursor was at an empty line, do not offer this line but the first non-empty line below it. ii) Source editor was not selected. Field "Line Number" is not pre-filled. In both cases, perform a check at the moment the user presses the OK button. If an empty (or invalid) line number is entered in the "Line Number" field, display a warning and offer another line number (again, the first non-empty...). b) The source code is not available The only way how to check whether a line number is legal is to get a list of VM locations of a ReferenceType (see package com.sun.jdi). This is possible only if the debugger is running and the class (represented by an object of type ReferenceType) is prepared.
Specification of a "blank line" must be added, e.g.: "Blank line is a line we know it does not contain anything except comments."
Changed target milestone 3.3 -> next release.
I agree that this is ugly behavior. Raising priority to P3.
This should be resolved in 5.1 See also issue #69462.
Implemented in NetBeans 6.9 by http://hg.netbeans.org/main/rev/d54c1f0ad3dc