Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 2.1.1RC1
-
Fix Version/s: None
-
Component/s: Quick fix/assist
-
Labels:None
-
Number of attachments :
Description
In GRECLIPSE-929, there was discovered to be a problem with static and star imports when the organize imports operation was invoked. That is now fixed, but static and star imports are never deleted even when they are no longer referenced. Organize imports should be smart enough to remove them when appropriate and also to convert to non-star imports when appropriate.
| 1. | Organize imports doesn't respect relative imports | |
|
Unassigned |
Be careful with changes in this area, some treatment of static/star imports is already erratic. If I take this code (with junit 4 on the classpath):
import org.junit.*
import static Assert.assertEquals
class Foo {
{ assertEquals(2,2) }public static void main(String[] argv)
}
and run 'organize imports' on it, I currently get:
import static org.junit.Assert.assertEquals
import org.junit.*
class Foo {
public static void main(String[] argv) { assertEquals(2,2) }
}
(because the Assert.assertEquals was correctly found relative to org.junit.* - whether the fact that it was eventually found using a path relative to another node is probably not recorded in the node)