Bug 154783

Summary: Wrong debug attributes
Product: [Eclipse Project] JDT Reporter: Olivier Thomann <Olivier_Thomann>
Component: CoreAssignee: Srikanth Sankaran <srikanth_sankaran>
Status: VERIFIED WORKSFORME QA Contact:
Severity: normal    
Priority: P3 CC: john.arthorne, srikanth_sankaran
Version: 3.2   
Target Milestone: 3.6 M7   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Olivier Thomann CLA 2006-08-22 19:52:11 EDT
In this test case the stepping is completely wrong. The "wrong" return statement is highlighted.

Steps to reproduce:

1) Put a breakpoint on the first line of doit and keep hitting Step Over.  It returns on "if (hash > 5) return", but the earlier return statement is highlighted.

public class A {
	public void doit(Object o) {
		try {
			if (o instanceof String)
				return;
			if (o != null) {
				int hash = o.hashCode();
				if (hash > 5)
					return;
			}
		} finally {
			System.out.println(o);
		}
	}
	public static void main(String[] arguments) {
		new A().doit(new Integer(6));
	}
}
Comment 1 Olivier Thomann CLA 2006-08-23 14:07:53 EDT
This is a consequence of sharing the same subroutine code generation for the two returns statements. After the subroutine has been called, the return position is wrong.
Comment 2 Srikanth Sankaran CLA 2010-02-26 04:51:23 EST
Will follow up.
Comment 3 Srikanth Sankaran CLA 2010-03-29 06:01:17 EDT
Olivier, This problem is no longer reproducible on HEAD.
Stepping works as expected.

I spent some time searching for defects which the current
one could be a duplicate of and didn't come up with anything
obvious.

OK to close as INVALID ?
Comment 4 Srikanth Sankaran CLA 2010-03-31 01:14:56 EDT
The stepping behavior is proper at least beginning 3.4.2
and on HEAD as well. Closing as WORKSFORME.
Comment 5 Olivier Thomann CLA 2010-04-26 14:29:27 EDT
Verified for 3.6M7 using I20100425-2000