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 5.4.0.20130703

Given the following code snippet in a Rails app:

...
1    result = Hash.new
2 *  Outer.all.each do |outer|
3      result[outer.name] = Hash.new
4      Inner.all.each do |inner|
5        result[outer.name][inner.value] = compute_stuff(data[key][outer.id][inner.id]) unless data[key][outer.id][inner.id].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.

Thanks,
Andy

2 comments

Hi Andy,

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

Regards, Oleg.

0

Great. Thanks - wanted to confirm that.

0

Please sign in to leave a comment.