Community
Participate
Working Groups
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; } } }
Alternatively, it could simply report this against the method, like we do for unassigned blank fields.
No more complaining against last statement if any. The method is simply blamed (like we did if it had no statement). Fixed
*** Bug 29343 has been marked as a duplicate of this bug. ***
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.
Verified.
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.
I don't agree on this. The method has a problem, not the return type.
The problem in the method is it does not respect the return type.