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

Bug 369053

Summary: [content assist] Completion for an anonymous inner class should not result in syntax error (missing methods)
Product: [Eclipse Project] JDT Reporter: Lars Vogel <Lars.Vogel>
Component: TextAssignee: JDT-Text-Inbox <jdt-text-inbox>
Status: RESOLVED WORKSFORME QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, deepakazad, kkazmierczyk+eclipse, Lars.Vogel, remy.suen, sbouchet
Version: 3.8   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Lars Vogel CLA 2012-01-19 05:25:37 EST
If I use code completion to create an anonymous inner class based on an abstract class or an interface the required methods do not get implemented. 

This results in an syntax error and I need to use Ctrl + 1 to create the required methods.

I think it would be better to generate the required methods directly. This is also how IntelliJ does it and there users seem to appreciate this.
Comment 1 Dani Megert CLA 2012-02-06 09:43:19 EST
3.8 M5.

Have:

package p;

abstract class Abstract {
	public abstract void doIt();
}

public class Testle {

	void a() {
		new Abstrac<content assist here>
	}
}

==>


package p;

abstract class Abstract {
	public abstract void doIt();
}

public class Testle {

	void a() {
		new Abstract() {
			
			@Override
			public void doIt() {
				// TODO Auto-generated method stub
				
			}
		};
	}
}
Comment 2 Lars Vogel CLA 2012-02-06 17:37:35 EST
Works for me too. Sorry for this bug.