@@ -70,34 +70,36 @@ class ModelImporter(private val root: INode, private val continueOnError: Boolea
70
70
*/
71
71
@JvmName(" importData" )
72
72
fun import (data : ModelData ) {
73
- logImportSize(data.root, logger)
74
- logger.info { " Building indices for import..." }
75
- originalIdToExisting.clear()
76
- postponedReferences.clear()
77
- nodesToRemove.clear()
78
- numExpectedNodes = countExpectedNodes(data.root)
79
- currentNodeProgress = 0
80
- buildExistingIndex(root)
81
-
82
- logger.info { " Importing nodes..." }
83
- data.root.originalId()?.let { originalIdToExisting[it] = root }
84
- syncNode(root, data.root)
85
-
86
- logger.info { " Synchronizing references..." }
87
- postponedReferences.forEach {
88
- doAndPotentiallyContinueOnErrors {
89
- it.invoke()
73
+ INodeResolutionScope .runWithAdditionalScope(root.getArea()) {
74
+ logImportSize(data.root, logger)
75
+ logger.info { " Building indices for import..." }
76
+ originalIdToExisting.clear()
77
+ postponedReferences.clear()
78
+ nodesToRemove.clear()
79
+ numExpectedNodes = countExpectedNodes(data.root)
80
+ currentNodeProgress = 0
81
+ buildExistingIndex(root)
82
+
83
+ logger.info { " Importing nodes..." }
84
+ data.root.originalId()?.let { originalIdToExisting[it] = root }
85
+ syncNode(root, data.root)
86
+
87
+ logger.info { " Synchronizing references..." }
88
+ postponedReferences.forEach {
89
+ doAndPotentiallyContinueOnErrors {
90
+ it.invoke()
91
+ }
90
92
}
91
- }
92
93
93
- logger.info { " Removing extra nodes..." }
94
- nodesToRemove.forEach {
95
- doAndPotentiallyContinueOnErrors {
96
- it.remove()
94
+ logger.info { " Removing extra nodes..." }
95
+ nodesToRemove.forEach {
96
+ doAndPotentiallyContinueOnErrors {
97
+ it.remove()
98
+ }
97
99
}
98
- }
99
100
100
- logger.info { " Synchronization finished." }
101
+ logger.info { " Synchronization finished." }
102
+ }
101
103
}
102
104
103
105
private fun countExpectedNodes (data : NodeData ): Int =
@@ -110,9 +112,7 @@ class ModelImporter(private val root: INode, private val continueOnError: Boolea
110
112
doAndPotentiallyContinueOnErrors {
111
113
syncProperties(node, data)
112
114
syncChildren(node, data)
113
- INodeResolutionScope .runWithAdditionalScope(node.getArea()) {
114
- syncReferences(node, data)
115
- }
115
+ syncReferences(node, data)
116
116
}
117
117
}
118
118
0 commit comments