Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 496120

Summary: Selecting the quick-fix to override a default method results in a compile-time error
Product: [Eclipse Project] JDT Reporter: Raffi Khatchadourian <raffi.khatchadourian>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: noopur_gupta, raffi.khatchadourian
Version: 3.1   
Target Milestone: ---   
Hardware: Macintosh   
OS: Mac OS X   
Whiteboard:

Description Raffi Khatchadourian CLA 2016-06-14 12:07:13 EDT
Consider the following example that contains a compile-time error on class B:

interface I {
	default void m() {
	}
}

interface J {
	void m();
}

public abstract class A implements I {
}

class B extends A implements J {
}

Selecting the quick-fix to "override the default method in I" results in:

class B extends A implements J {

	@Override
	public void m() {
		// TODO Auto-generated method stub
		A.super.m();
	}
}

However, A is not an interface and, as such, cannot be used in the manner it is being used in above. I believe that the correct quick-fix should be:

class B extends A implements J {

	@Override
	public void m() {
		// TODO Auto-generated method stub
		super.m();
	}
}

-- Configuration Details --
Product: Eclipse 4.5.2.20160218-0600 (org.eclipse.epp.package.committers.product)
Installed Features:
 org.eclipse.jdt 3.11.2.v20160212-1500
Comment 1 Noopur Gupta CLA 2016-06-15 01:53:46 EDT
This is fixed in Eclipse 4.6 M7.

*** This bug has been marked as a duplicate of bug 489934 ***