Replace HashSet's with LinkedHashSet's for consistent behavior
This commit is contained in:
@@ -31,7 +31,7 @@ import org.jetbrains.jet.lang.resolve.scopes.*
|
||||
import org.jetbrains.jet.utils.Printer
|
||||
|
||||
import org.jetbrains.jet.lang.resolve.QualifiedExpressionResolver.LookupMode
|
||||
import java.util.HashSet
|
||||
import java.util.LinkedHashSet
|
||||
|
||||
public class LazyImportScope(private val resolveSession: ResolveSession,
|
||||
private val containingDeclaration: PackageViewDescriptor,
|
||||
@@ -160,7 +160,7 @@ public class LazyImportScope(private val resolveSession: ResolveSession,
|
||||
|
||||
override fun getDescriptors(kindFilterMask: Int, nameFilter: (Name) -> Boolean): Collection<DeclarationDescriptor> {
|
||||
return resolveSession.getStorageManager().compute {
|
||||
val descriptors = HashSet<DeclarationDescriptor>()
|
||||
val descriptors = LinkedHashSet<DeclarationDescriptor>()
|
||||
for (directive in importsProvider.getAllImports()) {
|
||||
if (directive == directiveUnderResolve) {
|
||||
// This is the recursion in imports analysis
|
||||
|
||||
@@ -61,7 +61,7 @@ public class ChainedScope(private val containingDeclaration: DeclarationDescript
|
||||
|
||||
override fun getDescriptors(kindFilterMask: Int,
|
||||
nameFilter: (Name) -> Boolean): Collection<DeclarationDescriptor> {
|
||||
val result = HashSet<DeclarationDescriptor>()
|
||||
val result = LinkedHashSet<DeclarationDescriptor>()
|
||||
scopeChain.flatMapTo(result) { it.getDescriptors(kindFilterMask, nameFilter) }
|
||||
return result
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user