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.

Bug 15994 - Warn before (or do not allow) adding a breakpoint on an empty line.
Summary: Warn before (or do not allow) adding a breakpoint on an empty line.
Status: RESOLVED FIXED
Alias: None
Product: debugger
Classification: Unclassified
Component: Code (show other bugs)
Version: 3.x
Hardware: All All
: P3 blocker with 2 votes (vote)
Assignee: issues@debugger
URL:
Keywords:
Depends on:
Blocks: 28004
  Show dependency tree
 
Reported: 2001-09-27 15:26 UTC by Marian Petras
Modified: 2010-05-24 13:32 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marian Petras 2001-09-27 15:26:49 UTC
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.
Comment 1 Marian Petras 2001-09-27 15:30:07 UTC
Specification of a "blank line" must be added, e.g.:

"Blank line is a line we know it does not contain anything except
comments."
Comment 2 Marian Petras 2001-09-27 15:56:11 UTC
Changed target milestone 3.3 -> next release.
Comment 3 Martin Entlicher 2005-05-13 16:15:48 UTC
I agree that this is ugly behavior. Raising priority to P3.
Comment 4 Martin Entlicher 2005-12-12 18:32:16 UTC
This should be resolved in 5.1 See also issue #69462.
Comment 5 Martin Entlicher 2010-05-24 13:32:34 UTC
Implemented in NetBeans 6.9 by http://hg.netbeans.org/main/rev/d54c1f0ad3dc