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

Bug 317497

Summary: [content assist] Overriding content assist suggestion immediately after closing brace generates invalid code
Product: [Eclipse Project] JDT Reporter: Remy Suen <remy.suen>
Component: TextAssignee: Dani Megert <daniel_megert>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, Olivier_Thomann
Version: 3.6   
Target Milestone: 3.7 M4   
Hardware: All   
OS: All   
Whiteboard:

Description Remy Suen CLA 2010-06-21 14:08:51 EDT
I20100603-1500

public class Test {
  public void v() {
  }//<-invoke CC here
}

Select the second option, the clone() method, and you will get...

public class Test {
  public void v() {
  }protected Object clone() throws CloneNotSupportedException {};//<-invoke CC here
}

...if you put a space first, you will get...

public class Test {
  public void v() {
  } @Override
	protected Object clone() throws CloneNotSupportedException {
		// TODO Auto-generated method stub
		return super.clone();
	}//<-invoke CC here
}
Comment 1 Dani Megert CLA 2010-11-15 08:22:57 EST
This is a bug in JDT Text. Fixed in OverrideCompletionProposal rev. 1.40.
Available in builds >= N20101115-2000.