Bug 538031 - [content assist] Auto completion of faulty import statement produces excess semi colon
Summary: [content assist] Auto completion of faulty import statement produces excess s...
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.8   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2018-08-17 06:45 EDT by Lukas Eder CLA
Modified: 2022-10-02 14:57 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lukas Eder CLA 2018-08-17 06:45:32 EDT
Consider this correct code:

-----------------------------------------------------------------
package p1;

import p2.C;

public class C1 {}
-----------------------------------------------------------------
package p2;

public class C {}
-----------------------------------------------------------------

Now, let's assume, I'm manually renaming C to C2 (i.e. not using the refactor -> rename operation)

-----------------------------------------------------------------
package p2;

public class C2 {}
-----------------------------------------------------------------

Obviously, C1 now no longer compiles. I want to manually fix C1 using auto completion on the package name, so I put my cursor on "p2.C", hit Ctrl+Space and I get this

-----------------------------------------------------------------
package p1;

import p2.C2;;

public class C1 {}
-----------------------------------------------------------------

There is now an excess semi colon. Content assist should check if there already is a semi colon at the end of the import statement, and then not re-generate another one.
Comment 1 Eclipse Genie CLA 2020-10-05 02:46:44 EDT
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.

If you have further information on the current state of the bug, please add it. 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 2 Eclipse Genie CLA 2022-10-02 14:57:34 EDT
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.

If you have further information on the current state of the bug, please add it. 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.