Bug 154783 - Wrong debug attributes
Summary: Wrong debug attributes
Status: VERIFIED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.6 M7   Edit
Assignee: Srikanth Sankaran CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-08-22 19:52 EDT by Olivier Thomann CLA
Modified: 2010-04-26 14:29 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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