Bug 392897 - import static adds an extra semicolon
Summary: import static adds an extra semicolon
Status: CLOSED DUPLICATE of bug 15589
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.3   Edit
Hardware: PC Windows 7
: P3 minor (vote)
Target Milestone: 4.15 M3   Edit
Assignee: Stephan Herrmann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 478245 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-10-26 05:35 EDT by Lars Svensson CLA
Modified: 2020-02-11 15:09 EST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lars Svensson CLA 2012-10-26 05:35:35 EDT
This is a very common way to add a static import:

If you copy an existing static import:

import static mypack1.mypack2.MyClass.myMember1;

Then delete some of the text (here the last '1') to change member:

import static mypack1.mypack2.MyClass.myMember;

With Code assist (still with the prompt before last semi colon) you change to another member. Then you will get double semi colons:

import static mypack1.mypack2.MyClass.myMember2;;

Witch will not compile...
Comment 1 Jay Arthanareeswaran CLA 2012-10-26 08:19:03 EDT
We seem to do that for all imports, not just for static import. While one can argue that it is better to avoid inserting the semi colon if it is there already, I don't think it's worth the effort. For the record, there are other cases as well where we don't do that: e.g. java.util.Map_> ('_' being the cursor location)

I am closing this as WONTFIX. However, if you think there is a compelling reason to get this fixed, feel free to reopen it.
Comment 2 Stephan Herrmann CLA 2012-10-30 12:21:09 EDT
As I don't like the current situation myself I searched the history and found:

- Bug 15589 - code assist adds extra semicolons in import type declarations
  - deferred as LATER, then automatically closed as WONTFIX

Wow, might be cool, to finally close that historic bug :)

But I agree it's not a priority currently, so I agree with the resolution for the time being.

Verified for 4.3 M3.
Comment 3 Noopur Gupta CLA 2015-09-24 09:08:49 EDT
*** Bug 478245 has been marked as a duplicate of this bug. ***
Comment 4 Pascal Rapicault CLA 2015-09-24 10:27:32 EDT
These are the types of detail that make Eclipse look bad/dumb. I'm reopening because I disagree with the decision of WONTFIX.
Comment 5 Eclipse Genie CLA 2020-02-09 20:16:00 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 6 Stephan Herrmann CLA 2020-02-11 15:09:37 EST
Will be resolved via the other (much older) bug.

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