Community
Participate
Working Groups
I20050202 1. Create the following cu: public class X { void foo(String[] array, String s) { System.out.println(array + s); } void bar() { foo( // breakpoint here new String[] {}, ""); } public static void main(String[] args) { new X().bar(); } } 2. Add a breakpoint where indicated 3. Debug 4. When the breakpoint is hit, step into (F5) 3 times Observe: On the third "step into", the method foo is entered, but it was the argument "" that was highlighted. If you change the test case as follows (just adding 'this' as the receiver): public class X { void foo(String[] array, String s) { System.out.println(array + s); } void bar() { this.foo( // breakpoint here new String[] {}, ""); } public static void main(String[] args) { new X().bar(); } } then foo is entered only on the 4th step (as expected).
The difference between the two examples is that an explicit this (second case) adds its own entry in the line number table attributes. The fix would be to add a fake entry when the this is implicit. I will investigate.
Changes required in: ArrayReference.java FieldReference.java MessageSend.java QualifiedNameReference.java Reference.java SingleNameReference.java Now the two scenarii are identical in term of stepping.
Fixed and released in HEAD.
Verified in I20050215-2300