Bug 304449 - [content assist] 'anonymous inner type' completion inserts too many semicolons
Summary: [content assist] 'anonymous inner type' completion inserts too many semicolons
Status: CLOSED DUPLICATE of bug 280801
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.6   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-02 23:03 EST by Boris Bokowski CLA
Modified: 2010-03-04 03:07 EST (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 Boris Bokowski CLA 2010-03-02 23:03:42 EST
I don't have a minimal case for reproducing this (yet), but I'll report it anyway:

Given the following line with the cursor marked as "|":
private IPreferenceChangeListener listener = new IPre|

I use Ctrl-Space and the first code completion suggestion is to create a new anonymous inner type. Selecting that first suggestion yields the following:

private IPreferenceChangeListener listener = new IPreferenceChangeListener() {
	
	public void preferenceChange(PreferenceChangeEvent event) {
		// TODO Auto-generated method stub
		
	}
};|;;

Again, the cursor is marked using "|" - it's after the first semicolon but there are two more semicolons that don't belong there. Also, I would expect the cursor to be in the empty line after the TODO tag.

Seems to be sensitive to in which compilation unit you do this - I tried reproducing with a minimal project but couldn't.
Comment 1 Srikanth Sankaran CLA 2010-03-02 23:59:29 EST
Ayush, Please follow up - (Move to JDT/UI if needed.)
Comment 2 Ayushman Jain CLA 2010-03-03 06:13:57 EST
Doesnt look like a problem in the JDT core side. The proposals are correctly generated and collected by the UI. The selected proposal is inserted from
org.eclipse.jdt.internal.ui.text.java.AnonymousTypeCompletionProposal.createNewBody(ImportRewrite). 
Move to JDT/UI for comment
Comment 3 Markus Keller CLA 2010-03-03 10:09:11 EST
Content assist in the UI is JDT Text.
Comment 4 Dani Megert CLA 2010-03-04 03:07:37 EST

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