I'm working on a java project in Netbeans. I have a for loop which runs 29 times and each iteration takes about 1 minute to complete. The problem is in the 29th iteration of the loop. Is there any way that I can SKIP the first 28 iterations and go directly to the one in question?
I know I can put a conditional breakpoint, but that dosent make the debugger skip the iterations, it just notifies me when a paticular iteration is reached.
Please Help! Otherwise, this would take a awful lot of time to debug!
You could use something like the Java Platform Debugger Architecture . That might help. On the other hand, you could do something like so:
for (int i = 0; i < ...; i++)
{
if (i == 28)
{
System.out.println("Line Found"); //put breakpoint here
}
//remainder of the code.
}
This should allow you to trigger a breakpoint on the 29th execution of the loop and you can then use the step functions offered by the debugger to go over the code for the 29th iteration.
I have never used the JPDA, and even if I did I think that the most simple and straight forward solution would be to do something like the code above.
You could put a temporary line of code inside your loop, and put a breakpoint on that:
if (i=29) {
// Put a breakpoint on this line (only hit if i=29)
}
Change the loop condition.
for (int index = 27; index < 28; index++) {
...
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.