Java Reference
In-Depth Information
change from run to run, so this conditional breakpoint setting must be reset with
each run.
When enabled, the breakpoint applies only to an object's instance whose
ID
is
included in the instance filter list. This option is useful for following the progress
of a single object instance as it travels through code paths shared with many other
instances, such as when you're working with objects in collections.
Breaking only for certain classes
You can use class filters to narrow the scope of breakpoints so they apply only to
particular classes. Simple wildcard expansion can be used to match the fully
qualified class name. The filter format is limited to either an exact match or a pat-
tern match beginning or ending with an asterisk. For example:
■
com.acme.conversion.currency.Currency
matches a single class,
Currency
.
■
com.acme.conversion.currency.*
matches all classes in the
currency
pack-
age and its subpackages.
■
java.*
matches all classes in the core
java
packages.
■
*Listener
matches any class whose name ends with
Listener
.
To create a set of class filters for a breakpoint, enable the
Class filters
option and
type in the pattern or list of patterns delimited by spaces. By using a minus sign
before a pattern, you can exclude matching class(es) from the scope.
As an alternative to typing, you can click the ellipsis button next to the text box
to show the
Class Filters
dialog; there you can specify the set of patterns using
the
IDEA
's
find class by name
feature.
Breaking after a certain number of passes
This option lets you create breakpoints that become active only after they have
been reached a certain number of times. To enable this condition, enter a
numeric value in the
Pass count
field of the
Conditions
option group, and select
the checkbox. The
Pass count
value is the threshold for enabling this breakpoint,
meaning that the breakpoint is active for all subsequent passes once this thresh-
old has been crossed. It doesn't specify which execution pass to debug, but rather
the number of passes to skip before debugging.
This option is useful for debugging loops or other lines of code that are called
repeatedly. For example, if you want to examine the last iteration of a loop that
runs 10,000 times, but you don't feel like stepping through it for an hour, set the
Pass count
option to 9,999 to trigger your debugging action on the last iteration.