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

Bug 318180

Summary: [content assist] Auto-complete insertion of anonymous class produces superfluous semicolon
Product: [Eclipse Project] JDT Reporter: Matthew Wilson <mj.wilson.uk>
Component: TextAssignee: JDT-Text-Inbox <jdt-text-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, Olivier_Thomann, srikanth_sankaran
Version: 3.7   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Matthew Wilson CLA 2010-06-28 10:06:17 EDT
Build Identifier: 20100617-1415

When I insert an anonymous inner class using the autocomplete feature, a superfluous semicolon is added after the closing brace.  This semicolon is only required when the class is used in a field or local variable declaration, and not when the instance is used as a method parameter or as part of another expression.

This issue has occurred for me from at least 20090619-0625 to 20100617-1415.


Reproducible: Always

Steps to Reproduce:
1. Type:

foo(new ActionListener);

2. Place cursor after "ActionListener".
3. Press ctrl-space for autocomplete and choose "Anonymous Inner Type ..."
4. Witness that the code now has a superfluous (and, indeed, incorrect) semicolon on the last line:

};);

I expect:

});
Comment 1 Srikanth Sankaran CLA 2010-07-25 22:49:22 EDT
Is this a duplicate of bug 280801 ?
Comment 2 Dani Megert CLA 2010-07-26 03:03:26 EDT

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