Bug 27298

Summary: Must return result error could be more accurate
Product: [Eclipse Project] JDT Reporter: Jerome Lanneluc <jerome_lanneluc>
Component: CoreAssignee: Philipe Mulet <philippe_mulet>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: bob
Version: 2.1   
Target Milestone: 2.1 M5   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

Description Jerome Lanneluc CLA 2002-11-28 07:28:39 EST
Build 20021127

In the following cu, a 'method must return a result of type int' error is 
reported against the whole if statement. It should really report it against 
the 'System.out.println()' statement.

public class X {
	public int foo() {
		if (System.out != null) {
			System.out.println();
		} else {
			return 1;
		}
	}
}
Comment 1 Philipe Mulet CLA 2002-11-28 08:32:14 EST
Alternatively, it could simply report this against the method, like we do for 
unassigned blank fields.
Comment 2 Philipe Mulet CLA 2003-01-08 07:04:39 EST
No more complaining against last statement if any. The method is simply blamed 
(like we did if it had no statement).

Fixed
Comment 3 Philipe Mulet CLA 2003-01-13 04:23:33 EST
*** Bug 29343 has been marked as a duplicate of this bug. ***
Comment 4 Bob Foster CLA 2003-01-13 09:09:52 EST
Still visually confusing. The method signature is not in error. Flagging the
closing right brace nearest to the problem would be less confusing and way less
obtrusive.
Comment 5 David Audel CLA 2003-02-07 09:37:22 EST
Verified.
Comment 6 Bob Foster CLA 2003-03-10 00:32:39 EST
Now that I see the result in RC2, I realize that I was wrong but so is the
current "fix". Obviously, it is the return type that should be highlighted.
Comment 7 Jerome Lanneluc CLA 2003-03-10 07:51:13 EST
I don't agree on this. The method has a problem, not the return type.
Comment 8 Bob Foster CLA 2003-03-10 14:35:34 EST
The problem in the method is it does not respect the return type.