Java Reference
In-Depth Information
Stepping into a method (F7)
One of the most basic stepping actions is Step Into , which advances the execution
point to the next executable line of code. This lets you examine the program flow
one line at a time. Each time you step to the next executable line, the current execu-
tion point is shown in the editor window, even if the next line calls a method, taking
you into another class or source file. This is why this action is called Step Into —it
steps into methods it encounters. If you aren't interested in tracing the program
flow into the method, use the Step Over action. The option Force Step Into ( Shift+
F7 ) can be used to step into methods normally ignored by the debugger. By default,
all synthetic methods and the core Java classes are skipped over during stepping.
The new version of IDEA also includes a Skip Simple Getters option. These
methods are trivial and are typically stepped over manually in most debugging
sessions. Having the debugger skip them automatically is a convenience that will
save you time.
Stepping over a method call (F8)
The Step Over action advances the execution point just as Step Into does, but it
doesn't drill down into method calls it encounters. It executes the next line in the
current method or, when the method is completed, the next line in the current
source file, jumping over method calls. It's important to understand that the code
inside the stepped-over method call is still executed; you just aren't given the
opportunity to trace the program through it. The debugging options discussed
later in this chapter conveniently allow you to specify classes that should always be
skipped over (for the project), saving you the trouble.
If the method you intend to step over contains breakpoints, IDEA ig-
nores the request to step over the method and shows the breakpoints
specified. It does so to ensure that all breakpoints do their job in show-
ing you the runtime information required to debug your application.
NOTE
Force Step Over in IDEA 5, as mentioned previously, does ignore embedded
breakpoints.
Stepping out of a method (F8) XE “stepping out” (Shift+F8)
Once you've stepped into a method for a closer look, the Step Out action lets you
get back out. When you step out of a method, execution of the program resumes
 
 
 
 
 
 
 
 
 
Search WWH ::




Custom Search