Organize imports removes import needed for nested import
Organizing imports on
import java.util.Collections
class Bug {
import Collections.emptyList
def test = emptyList
}
removes import java.util.Collections
, breaking the code.
Leave a comment
Interestingly, if one organizes imports on
import java.util.Collections
class Bug2 {
import java.util.Collections.emptyList
def test = emptyList
}
import java.util.Collections
is not removed, although it should be dropped. If we start withimport java.util.Collections.emptyList
class Bug3 {
import java.util.Collections.emptyList
def test = emptyList
}
the toplevel import java.util.Collections.emptyList
is replaced with import java.util.Collections
instead of being removed entirely.
Treat nested imports more carefully
This commit overworks the way nested imports are treated when calculating
compilation unit dependencies. Prior to this commit, nested imports were
often simply ignored, resulting in breakage like ticket #1002613. To mitigate
this problem, it was necessary to add more bookkeeping to the dependency
calculation algorithm.
Fixes #1002613
Branch: master
Commit: scala-ide:5d67df7a0e
This commit overworks the way nested imports are treated when calculating
compilation unit dependencies. Prior to this commit, nested imports were
often simply ignored, resulting in breakage like ticket #1002613. To mitigate
this problem, it was necessary to add more bookkeeping to the dependency
calculation algorithm.
Fixes #1002613
Branch: master
Commit: scala-ide:5d67df7a0e