Community
Participate
Working Groups
build I20090126-1300 1) create test/Test.java package test; public class Test{ public static void main(String[] args) { new Test().new Inner().foo(); } public class Inner { public void foo() { int i = 0; final int NEW = 1; if (i == NEW) {// line 11 System.out.println();// line 12 } bar();// line 14 } } public void bar() { System.out.println(); } } 2) put a breakpoint on line 11 and debug this program 3) when the you hit the breakpoint do a step into the cursor move on line 12 but it should move on line 14 because the condition is false. Open the generated test/Test$Inner.class to see the following content // Method descriptor #14 ()V // Stack: 2, Locals: 3 public void foo(); 0 iconst_0 1 istore_1 [i] 2 iconst_1 3 istore_2 [NEW] 4 iload_1 [i] 5 iconst_1 6 if_icmpne 15 9 getstatic java.lang.System.out : java.io.PrintStream [20] 12 invokevirtual java.io.PrintStream.println() : void [26] 15 aload_0 [this] 16 getfield test.Test$Inner.this$0 : test.Test [10] 19 invokevirtual test.Test.bar() : void [31] 22 return Line numbers: [pc: 0, line: 9] [pc: 2, line: 10] [pc: 4, line: 11] [pc: 9, line: 12] [pc: 19, line: 14] [pc: 22, line: 15] Local variable table: [pc: 0, pc: 23] local: this index: 0 type: test.Test.Inner [pc: 2, pc: 23] local: i index: 1 type: int [pc: 4, pc: 23] local: NEW index: 2 type: int I think that the pc for line number 14 should be 15 instead of 19.
We should update the line number information before we dump the receiver and not after.
Created attachment 124053 [details] Proposed fix I'll add a regression test.
Created attachment 124055 [details] Same patch with regression test
Released for 3.5M6. Regression test added in org.eclipse.jdt.core.tests.compiler.regression.DebugAttributeTest#test004
Verified for 3.5M6 using I20090310-0100