Bug 94303 - import static adds annoying semicolon
Summary: import static adds annoying semicolon
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 minor (vote)
Target Milestone: 3.1 RC1   Edit
Assignee: David Audel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 94122 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-05-10 09:41 EDT by David Saff CLA
Modified: 2005-05-27 09:07 EDT (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 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.