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

Bug 490742

Summary: Quick fix for default method that calls a non-existent method produces incorrect code
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-03-30 22:01:11 EDT
Suppose we have this interface:

interface I {
	default void m() {
		n();
	}
}

It results in a compilation error because method n() does not exist. If I choose the quick fix to "create method n()," I get this code:

interface I {
	default void m() {
		n();
	}

	default void n();
}

which has incorrect syntax. I think that it should be either void n(); or default void n() {}.

-- 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-03-31 00:57:43 EDT

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