IDEA-302307 call replaceBySource only once

GitOrigin-RevId: 49411790b241136af829ddd8e4afae23f0dc3530
This commit is contained in:
Dmitry Kichinsky
2023-01-20 23:32:55 +01:00
committed by intellij-monorepo-bot
parent da262435e7
commit 04040318cd

View File

@@ -315,8 +315,6 @@ internal class WorkspaceProjectImporter(
currentStorage.replaceBySource({ isMavenEntity(it) }, newStorage)
currentStorage.replaceBySource({ it is MavenProjectsTreeEntitySource }, newStorage)
// Now we have some modules with duplicating content roots. One content root existed before and another one exported from maven.
// We need to move source roots and excludes from existing content roots to the exported content roots and remove (obsolete) existing.
modulesWithDuplicatingRoots.asSequence()
@@ -484,6 +482,7 @@ internal class WorkspaceProjectImporter(
private fun isMavenEntity(it: EntitySource) =
(it as? JpsImportedEntitySource)?.externalSystemId == WorkspaceModuleImporter.EXTERNAL_SOURCE_ID
|| it is MavenProjectsTreeEntitySource
private fun readMavenExternalSystemData(storage: EntityStorage) =
importedEntities(storage, ExternalSystemModuleOptionsEntity::class.java)