From 91b0015ec7d9119141c9ac3680d7b0b81b259f7b Mon Sep 17 00:00:00 2001 From: Xanonymous Date: Tue, 6 Aug 2024 12:52:42 +0100 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20should=20copy=20all=20nod?= =?UTF-8?q?e=20info=20when=20action=20created?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tw/xcc/gumtree/model/operations/SingleDeleteAction.kt | 2 +- .../tw/xcc/gumtree/model/operations/SingleInsertAction.kt | 2 +- .../tw/xcc/gumtree/model/operations/SingleUpdateAction.kt | 2 +- .../kotlin/tw/xcc/gumtree/model/operations/TreeDeleteAction.kt | 2 +- .../kotlin/tw/xcc/gumtree/model/operations/TreeInsertAction.kt | 2 +- .../kotlin/tw/xcc/gumtree/model/operations/TreeMoveAction.kt | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/core/src/main/kotlin/tw/xcc/gumtree/model/operations/SingleDeleteAction.kt b/core/src/main/kotlin/tw/xcc/gumtree/model/operations/SingleDeleteAction.kt index d2b7761..26944a1 100644 --- a/core/src/main/kotlin/tw/xcc/gumtree/model/operations/SingleDeleteAction.kt +++ b/core/src/main/kotlin/tw/xcc/gumtree/model/operations/SingleDeleteAction.kt @@ -3,6 +3,6 @@ package tw.xcc.gumtree.model.operations import tw.xcc.gumtree.model.GumTree data class SingleDeleteAction(override val node: GumTree) : Action(node, "DELETE") { - override val oldInfo: GumTree.Info = node.info + override val oldInfo: GumTree.Info = node.info.copy() override val newInfo: GumTree.Info? = null } \ No newline at end of file diff --git a/core/src/main/kotlin/tw/xcc/gumtree/model/operations/SingleInsertAction.kt b/core/src/main/kotlin/tw/xcc/gumtree/model/operations/SingleInsertAction.kt index cb4113b..396e9c7 100644 --- a/core/src/main/kotlin/tw/xcc/gumtree/model/operations/SingleInsertAction.kt +++ b/core/src/main/kotlin/tw/xcc/gumtree/model/operations/SingleInsertAction.kt @@ -8,5 +8,5 @@ data class SingleInsertAction( override val pos: Int ) : AdditionAction(node, parent, pos, "INSERT") { override val oldInfo: GumTree.Info? = null - override val newInfo: GumTree.Info = node.info + override val newInfo: GumTree.Info = node.info.copy() } \ No newline at end of file diff --git a/core/src/main/kotlin/tw/xcc/gumtree/model/operations/SingleUpdateAction.kt b/core/src/main/kotlin/tw/xcc/gumtree/model/operations/SingleUpdateAction.kt index 537ecfc..5823efb 100644 --- a/core/src/main/kotlin/tw/xcc/gumtree/model/operations/SingleUpdateAction.kt +++ b/core/src/main/kotlin/tw/xcc/gumtree/model/operations/SingleUpdateAction.kt @@ -13,5 +13,5 @@ data class SingleUpdateAction( type = oldType, text = oldText ) - override val newInfo: GumTree.Info = node.info + override val newInfo: GumTree.Info = node.info.copy() } \ No newline at end of file diff --git a/core/src/main/kotlin/tw/xcc/gumtree/model/operations/TreeDeleteAction.kt b/core/src/main/kotlin/tw/xcc/gumtree/model/operations/TreeDeleteAction.kt index 69b3d3e..5e919e2 100644 --- a/core/src/main/kotlin/tw/xcc/gumtree/model/operations/TreeDeleteAction.kt +++ b/core/src/main/kotlin/tw/xcc/gumtree/model/operations/TreeDeleteAction.kt @@ -3,6 +3,6 @@ package tw.xcc.gumtree.model.operations import tw.xcc.gumtree.model.GumTree data class TreeDeleteAction(override val node: GumTree) : TreeAction(node, "DELETE-TREE") { - override val oldInfo: GumTree.Info = node.info + override val oldInfo: GumTree.Info = node.info.copy() override val newInfo: GumTree.Info? = null } \ No newline at end of file diff --git a/core/src/main/kotlin/tw/xcc/gumtree/model/operations/TreeInsertAction.kt b/core/src/main/kotlin/tw/xcc/gumtree/model/operations/TreeInsertAction.kt index de060f9..7a8dbfc 100644 --- a/core/src/main/kotlin/tw/xcc/gumtree/model/operations/TreeInsertAction.kt +++ b/core/src/main/kotlin/tw/xcc/gumtree/model/operations/TreeInsertAction.kt @@ -8,5 +8,5 @@ data class TreeInsertAction( override val pos: Int ) : TreeAdditionAction(node, parent, pos, "TREE-DELETE") { override val oldInfo: GumTree.Info? = null - override val newInfo: GumTree.Info = node.info + override val newInfo: GumTree.Info = node.info.copy() } \ No newline at end of file diff --git a/core/src/main/kotlin/tw/xcc/gumtree/model/operations/TreeMoveAction.kt b/core/src/main/kotlin/tw/xcc/gumtree/model/operations/TreeMoveAction.kt index 938b359..b1ebfcb 100644 --- a/core/src/main/kotlin/tw/xcc/gumtree/model/operations/TreeMoveAction.kt +++ b/core/src/main/kotlin/tw/xcc/gumtree/model/operations/TreeMoveAction.kt @@ -9,7 +9,7 @@ data class TreeMoveAction( private val newLine: Int, private val newPosOfLine: Int ) : TreeAdditionAction(node, parent, pos, "TREE-MOVE") { - override val oldInfo: GumTree.Info = node.info + override val oldInfo: GumTree.Info = node.info.copy() override val newInfo: GumTree.Info = node.info.copy( line = newLine,