Bug 511965

Summary: Unused static import created when organizing imports
Product: [Eclipse Project] JDT Reporter: Clovis Seragiotto <clovis.seragiotto>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: ASSIGNED --- QA Contact:
Severity: normal    
Priority: P3 CC: jarthana, kalyan_prasad
Version: 4.6   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
See Also: https://git.eclipse.org/r/141951
https://git.eclipse.org/r/141960
Whiteboard: stalebug

Description Clovis Seragiotto CLA 2017-02-09 06:14:07 EST
For the following class

package a;

interface Foo {
    static void x() {  }
    
    class Bar implements Foo {
        static void y() { x(); }
    }
}

"organize imports" automatically adds "import static a.Foo.x;". And then the compiler complains that this import is never used.
Comment 1 Eclipse Genie CLA 2019-02-01 14:06:43 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.

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 Clovis Seragiotto CLA 2019-02-04 00:49:34 EST
The problem still occurs (Eclipse 2018-12)
Comment 3 Jay Arthanareeswaran CLA 2019-02-04 04:33:19 EST
Vikas, this looks like a good candidate for you. Can you take a look at this?
Comment 4 Vikas Chandra CLA 2019-02-04 04:50:22 EST
>>Can you take a look at this?

I will have a look.
Comment 5 Clovis Seragiotto CLA 2019-04-04 03:02:25 EDT
… and if x() is declared as private in the example, as in

interface Foo {
    private static void x() {  }
    …
}

then the compiler complains that the import cannot be resolved.
Comment 6 Eclipse Genie CLA 2019-05-10 06:33:16 EDT
New Gerrit change created: https://git.eclipse.org/r/141951
Comment 7 Eclipse Genie CLA 2019-05-10 08:27:18 EDT
New Gerrit change created: https://git.eclipse.org/r/141960
Comment 8 Eclipse Genie CLA 2021-04-30 04:43:51 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 9 Eclipse Genie CLA 2021-04-30 04:43:51 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. 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 10 Clovis Seragiotto CLA 2021-04-30 04:46:32 EDT
The useless import is still generated.
Comment 11 Eclipse Genie CLA 2024-03-19 01:42:12 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.