Fix addition of wrong java.lang imports on optimize imports

Add check to star importer, to not import already imported fqNames
 #KT-15273 fixed
This commit is contained in:
Simon Ogorodnik
2017-04-17 16:48:57 +03:00
parent dd4a5944f1
commit 9ca65fcf99
4 changed files with 31 additions and 1 deletions
@@ -155,8 +155,10 @@ class OptimizedImportsBuilder(
}
else {
descriptors
.asSequence()
.filterIsInstance<ClassDescriptor>()
.mapTo(classNamesToCheck) { it.importableFqName!! }
.map { it.importableFqName!! }
.filterTo(classNamesToCheck) { !isImportedByDefault(it) }
if (!fqNames.all(this::isImportedByDefault)) {
importsToGenerate.add(starImportPath)