Community
Participate
Working Groups
Build ID: I20070809-1105 Steps To Reproduce: 1. Two interfaces - TestInterfaceSub extends TestInterfaceSuper 2. static import of both interfaces into a class that uses constants from both interfaces 3. If the super interface is imported after the sub interface (for example - ordered alphabetically this way by Organize Imports), it is reported as unused. import static test.TestInterfaceSub.*; import static test.TestInterfaceSuper.*; If it is imported (and ordered) after the sub interface - it is not reported as unused. import static test.TestInterfaceSuper.*; import static test.TestInterfaceSub.*; More information:
This is not a bug. The constants from TestInterfaceSuper are inherited by TestInterfaceSub, so when the import statements are : import static test.TestInterfaceSub.*; import static test.TestInterfaceSuper.*; The second statement is unused & unnecessary since all constants defined by TestInterfaceSuper are found using 'import static test.TestInterfaceSub.*'.
Verified for 3.4M2
OK, it is unused, but how can you fix the warning. Even if you delete it, Organize Imports brings it back. And because I have Organize Imports added as a Save Action, I always have a warning. Probably the bug here is that Organize Imports adds it at all.
(In reply to comment #3) > Probably the bug here is that Organize Imports adds it at all. > Please open a separate bug report against JDT/UI