Skip to content

Commit 86b088e

Browse files
committed
refactor(model-sync-lib): moved data parameter from constructor to function
1 parent 2f2afaa commit 86b088e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

model-sync-lib/src/main/kotlin/org/modelix/model/sync/ModelImporter.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ import org.modelix.model.api.*
44
import org.modelix.model.data.ModelData
55
import org.modelix.model.data.NodeData
66

7-
class ModelImporter(private val branch: IBranch, private val data: ModelData) {
7+
class ModelImporter(private val branch: IBranch) {
88

99
companion object {
1010
const val idRole = "originalId"
1111
}
1212

1313
private lateinit var originalIdToRef: MutableMap<String, INodeReference>
1414

15-
fun import() {
15+
fun import(data: ModelData) {
1616
originalIdToRef = mutableMapOf()
1717
branch.runWrite {
1818
val rootNode = branch.getRootNode()

model-sync-lib/src/test/kotlin/org/modelix/model/sync/ModelImporterTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class ModelImporterTest {
3535
model.load(branch)
3636
// println("PRE-SPEC ${model.toJson()}")
3737
// println("PRE-LOADED ${branch.getRootNode().toJson()}")
38-
ModelImporter(branch, newModel).import()
38+
ModelImporter(branch).import(newModel)
3939
// println("POST-SPEC ${newModel.root.toJson()}")
4040
// println("POST-LOADED ${branch.getRootNode().toJson()}")
4141
}
@@ -82,7 +82,7 @@ class ModelImporterTest {
8282
val tempBranch = PBranch(tree, IdGenerator.getInstance(1))
8383
tempBranch.runWrite {
8484
assertDoesNotThrow {
85-
ModelImporter(tempBranch, newModel).import()
85+
ModelImporter(tempBranch).import(newModel)
8686
}
8787
val children = tempBranch.getRootNode().allChildren.toList()
8888
assertEquals(newModel.root.children.size, children.size)

0 commit comments

Comments
 (0)