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 251567 - Enable exception breakpoint condition to use thrown exception object (bind $thrownException ?)
Summary: Enable exception breakpoint condition to use thrown exception object (bind $t...
Status: NEW
Alias: None
Product: debugger
Classification: Unclassified
Component: Java (show other bugs)
Version: 8.0.2
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Martin Entlicher
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-01 15:42 UTC by nimarukan
Modified: 2015-04-01 15:42 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 nimarukan 2015-04-01 15:42:41 UTC
Make the thrown exception bound to a name that can be used in a condition of an exception breakpoint.

Steps to reproduce:
1. open Debug/"New Breakpoint" dialog
2. Breakpoint type: Exception
3. Exception class name: java.lang.ClassNotFoundException [for example]
4. Debug complex program.  
   Program suspends at java/net/URLClassLoader.java:366
   Variables pane shows
   [-] Thrown exception java.lang.ClassNotFoundException
      <> ex: null
      [+] Static
      [-] Inherited
         <> detailMessage: String: "pkg.ClassName"
         ...

So the thrown exception object is available at the breakpoint.
But it does not appear to be bound to a name.

If this thrown exception object is bound to a name, 
such as $thrownException,
then it can be used in the condition of the breakpoint.

Then it will be possible to set a condition that depends on the
detail messsage $thrownException.getMessage(), or the cause exception $thrownException.getCause(),
or other property of the thrown exception.
(In the above example, it would enable skipping all the many irrelevant ClassNotFoundExceptions that occur during class loading for many classes, and stop only on the ClassNotFoundExceptions for a particular class name.)

If this is implemented, please document the special name (such as $thrownException) on the help page for the breakpoint dialog, which has a link to
http://docs.oracle.com/cd/E50453_01/doc.80/e50452/run_debug_japps.htm#NBDAG856