Community
Participate
Working Groups
It appears "Source" > "Organize Imports" adds unnecessary static imports for interfaces when an anonymous class of the interface is created and within it a static method of the interface is called: ``` package test; // Apparently only happens for interfaces, but not for classes interface StaticImportTest { static void use(String s) { } default void test(String s) { // Must be anonymous class of enclosing interface new StaticImportTest() { { use(""); // <-- Static import is added for this } }; } } ``` However, since the method is declared in the same enclosing interface a warning is shown for the static import because it is not used: ``` // The import test.StaticImportTest.use is never used import static test.StaticImportTest.use; ``` Especially when "Organize Imports" is set as "Save Action" this can become annoying.
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.