Bug 94303

Summary: import static adds annoying semicolon
Product: [Eclipse Project] JDT Reporter: David Saff <david>
Component: CoreAssignee: David Audel <david_audel>
Status: VERIFIED FIXED QA Contact:
Severity: minor    
Priority: P3 CC: bmiller, daniel_megert, eclipse
Version: 3.1   
Target Milestone: 3.1 RC1   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description David Saff CLA 2005-05-10 09:41:46 EDT
Against I20050509-2010.

With a 1.5 JRE on the build path, open a java file, type the following at the top:

import static ElementType

and hit Ctrl+Space.  The result is 

import static java.lang.annotation.ElementType;

The semicolon will have to be deleted: the user is probably intending to add .*
or a specific field to import.
Comment 1 Martin Aeschlimann CLA 2005-05-10 11:58:33 EDT
I agree, 'import static java.lang.annotation.ElementType;' is a valid import but
you wouldn't do a static import of a type.
Comment 2 David Saff CLA 2005-05-10 12:02:27 EDT
Actually, it's a compile error: The static import
java.lang.annotation.ElementType must be a field or member type
Comment 3 Philipe Mulet CLA 2005-05-10 15:25:38 EDT
David - is that us or JDT/UI ?
Comment 4 David Audel CLA 2005-05-11 03:54:17 EDT
that's us
Comment 5 Tom Hofmann CLA 2005-05-12 04:56:44 EDT
*** Bug 94122 has been marked as a duplicate of this bug. ***
Comment 6 David Audel CLA 2005-05-23 10:01:44 EDT
Fixed and tests added
  CompletionTest_1_5#test0209() -> test0213()

if the import is static and the proposed type is top level type then a '.' is
added instead of ';'.

if you type
'import static ElementType<<complete here>>'
then the result will be
'import static java.lang.annotation.ElementType.'
Comment 7 Maxime Daniel CLA 2005-05-27 04:45:19 EDT
Verified on build I20050526-2000-win32.