Bug 66315 - [quick fix] suggest super for missing return in overriden methods
Summary: [quick fix] suggest super for missing return in overriden methods
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows 2000
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-06-09 11:13 EDT by Adam Kiezun CLA
Modified: 2016-06-24 05:35 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Kiezun CLA 2004-06-09 11:13:42 EDT
3.0 m7
 when i override a method and have a missing return statement, a quick fix 
could be offered to insert return that calls super
Comment 1 Midhun Vishnukripa CLA 2016-04-16 11:35:02 EDT
Can you be more specific of your post? May be with an example.
Comment 2 Noopur Gupta CLA 2016-04-18 05:40:54 EDT
(In reply to Midhun Vishnukripa from comment #1)
> Can you be more specific of your post? May be with an example.

public class A {
	int foo() {
		return -1;
	}
}

class B extends A {
	@Override
	int foo() { // error - quick fix to add "return super.foo();"
	}
}

Also, with Java 8:

interface I {
	default int foo() {
		return -1;
	}
}

class C implements I {
	@Override
	public int foo() { // error - quick fix to add "return I.super.foo();"
	}
}
Comment 3 Eclipse Genie CLA 2016-06-23 13:22:10 EDT
New Gerrit change created: https://git.eclipse.org/r/75869
Comment 4 Eclipse Genie CLA 2016-06-23 21:49:02 EDT
New Gerrit change created: https://git.eclipse.org/r/75894
Comment 5 Noopur Gupta CLA 2016-06-24 05:35:11 EDT
Midhun, please amend the same Gerrit request instead of creating new ones for the updates. 

Also, remove all the unnecessary changes like whitespace changes from the patch and make sure that there are no test failures in the build.