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 96186 - API for breakpoint validity
Summary: API for breakpoint validity
Status: CLOSED FIXED
Alias: None
Product: debugger
Classification: Unclassified
Component: Code (show other bugs)
Version: 6.x
Hardware: All All
: P1 blocker (vote)
Assignee: Martin Entlicher
URL:
Keywords: API, API_REVIEW_FAST
Depends on:
Blocks: 32796 89558
  Show dependency tree
 
Reported: 2007-02-21 16:59 UTC by Martin Entlicher
Modified: 2010-04-29 09:32 UTC (History)
0 users

See Also:
Issue Type: TASK
Exception Reporter:


Attachments
The proposed API change & test. (8.50 KB, patch)
2007-02-21 18:09 UTC, Martin Entlicher
Details | Diff
A new proposed API change & test. (8.66 KB, patch)
2007-02-23 21:55 UTC, Martin Entlicher
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Entlicher 2007-02-21 16:59:23 UTC
In order to be able to implement issue #89558 we need an API for breakpoint
validity.

org.netbeans.api.debugger.Breakpoint can be in three statii:
 - unknown (the breakpoint is set by the user, but it's not yet submitted into the
            target debuggee)
 - valid (the breakpoint is successfully submitted into the debuggee)
 - invalid (the breakpoint is on an invalid location, or it was not possible to
            submit it into the debuggee due to some error)

In case of invalid breakpoints, we need to inform the user about the reason.
Comment 1 Martin Entlicher 2007-02-21 18:09:05 UTC
Created attachment 38771 [details]
The proposed API change & test.
Comment 2 Martin Entlicher 2007-02-21 18:10:05 UTC
Please review this simple & compatible API addition. Thanks.
Comment 3 ivan 2007-02-22 22:36:14 UTC
some questions:
- why not use Java enums for validity? Then you can get "static" typechecking
  and do away with IllegalArgumentException.
- I'm assuming that the validity message will appear in the tip, so ...
  What is the interaction between validityMessage() and getSummary()?

some concerns
- As another client of this api I have a concern that I'm not
  in a position to verify through prototyping if this API will work for me.
  On the surface it looks reasonable but you never know until you try.
  I also understand that just because _my_ organization is unable to sync
  up with NB for some reason that NB should not be prevented from going
  ahead.
  
Comment 4 Martin Entlicher 2007-02-23 21:33:21 UTC
Ivan, thanks for the comments.
It's true that enum is much better here, I'll update the diff.

What do you mean by getSummary()? Don't you mean getPrintText()? That's just
JPDA API and it's used for other purpose. In debuggercore there is no suitable
method for that. It's true that it will be displayed in the tooltip and also a
warning will be printed into debugger console for invalid breakpoints.

I suppose that this API should be usable for other debuggers as well. I tried to
make it general enough, but I can not predict demands of other debuggers. If you
will find it insufficient later, we can either add more validity values or
extend the API in some other way according to concrete demands.
Comment 5 ivan 2007-02-23 21:37:57 UTC
getSummary() == NodeModel.getShortDescription()

I there exists a non-null validityMessage who wins in
the race for the tooltip? the validity message or 
getShortDescription()?
Comment 6 Martin Entlicher 2007-02-23 21:55:17 UTC
Created attachment 38880 [details]
A new proposed API change & test.
Comment 7 Martin Entlicher 2007-02-23 22:01:22 UTC
NodeModel.getShortDescription() is a different part of the code. In JPDA we'll
return Breakpoint.getValidityMessage() in NodeModel.getShortDescription()
(besides other description). It's in different modules, therefore we need to
have it in the API to be able to transfer the invalid message from
implementation module (JPDA Debugger) to UI module (JPDA Debugger UI).
My assumption is that it's handy to have that in the API even for others. So
that it can be retrieved programmatically.
Comment 8 Martin Entlicher 2007-02-23 22:03:18 UTC
To clarify: The tooltip is composed just from NodeModel.getShortDescription().
Breakpoint.getValidityMessage() is just an API method that can be used in the
implementation of NodeModel.getShortDescription().
Comment 9 ivan 2007-02-23 22:05:06 UTC
OK.
So an enahnced comment for getValidityMessage() would read:

Intended for use by ui implementation code, NodeModel.getShortDescription(), for
example.
Comment 10 Martin Entlicher 2007-02-23 22:12:24 UTC
Fine, I'll add that to the Javadoc.
Comment 11 Martin Entlicher 2007-02-28 09:35:42 UTC
Thanks for the review, I'll integrate this change today evening CET.
Comment 12 Martin Entlicher 2007-03-01 10:18:27 UTC
The API is committed to trunk:

/shared/data/ccvs/repository/debuggercore/api/apichanges.xml,v  <--  apichanges.xml
new revision: 1.8; previous revision: 1.7

/shared/data/ccvs/repository/debuggercore/api/manifest.mf,v  <--  manifest.mf
new revision: 1.15; previous revision: 1.14

/shared/data/ccvs/repository/debuggercore/api/nbproject/project.properties,v 
<--  project.properties
new revision: 1.8; previous revision: 1.7

/shared/data/ccvs/repository/debuggercore/api/src/org/netbeans/api/debugger/Breakpoint.java,v
 <--  Breakpoint.java
new revision: 1.7; previous revision: 1.6

/shared/data/ccvs/repository/debuggercore/test/unit/src/org/netbeans/api/debugger/BreakpointsTest.java,v
 <--  BreakpointsTest.java
new revision: 1.9; previous revision: 1.8
Comment 13 Quality Engineering 2010-04-29 09:32:11 UTC
Verified ... and Closing all issues resolved into NetBeans 6.7 and earlier.