Debug Step Over Behaviour - Is this correct?

IDEA 12.1.4 Build#IU-129.713, built on June 10, 2013 JDK 1.6.0_32
Ruby Plugin version

Given the following code snippet in a Rails app:

1    result =
2 *  Outer.all.each do |outer|
3      result[] =
4      Inner.all.each do |inner|
5        result[][inner.value] = compute_stuff(data[key][][]) unless data[key][][].blank?
6      end
7    end

I'm running the code in Intellij in the debugger with a breakpoint set at (*) Line 2.

If I hit F8 - Step Over, should the execution point end up on line 3? Or should it execute the next iteration of the entire do-loop (basically ending up back on line 2 after executing lines 3-6)? It's like the debugger is treating the do-loops like methods that I have to F7 - Step Into, into.

Looking for a sanity check.


Comment actions Permalink

Hi Andy,

"each" is a method (not a loop) and so debugger treats it so.

Regards, Oleg.

Comment actions Permalink

Great. Thanks - wanted to confirm that.


Please sign in to leave a comment.