I want to debug a huge collection of 760000 records but in record 54000 it hangs and I want to debug the loop but don't want to continue 54000 times manually.
Is it possible to put a condition in IntelliJ to stop the thread after a number of iterations?
I Don't know the exact size of the collection as it is an Iterable and I don't know how to get the index.
Edit: I guess I could work around it and edit the code to insert the counter in the loop and create a condition on a breakpoint to stop on the iteration I suspect wrong.
for (Item item: iterable) {
counter++;
}
And then condition the breakpoint.
counter==54000
But unfortunately, I can't amend the code to add that counter.
*Using Community Edition of IntelliJ
Right click on the breakpoint in question. It will open a small dialog box with a few options. Select More
at the bottom. Now you will see a context menu where you can set "pass count".
You can enter it in that box, regardless of whether you want to set other special conditions on your breakpoint.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With