Skip to content

Commit 2741984

Browse files
committed
fix(model-api): add default implementations for backwards compatibility
1 parent 1bb1231 commit 2741984

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

model-api/src/commonMain/kotlin/org/modelix/model/api/INode.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ interface INode {
5454
* @param concept the concept of the new node
5555
* @return replacement for this node with the new given concept
5656
*/
57-
fun replaceNode(concept: ConceptReference): INode
57+
fun replaceNode(concept: ConceptReference): INode {
58+
throw UnsupportedOperationException() // Default implementation to avoid breaking change
59+
}
5860

5961
/**
6062
* Role of this node in its parent node if it exists,or null otherwise.

model-api/src/commonMain/kotlin/org/modelix/model/api/ITreeChangeVisitor.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ interface ITreeChangeVisitor {
3131
*
3232
* @param nodeId id of the affected node
3333
*/
34-
fun conceptChanged(nodeId: Long)
34+
fun conceptChanged(nodeId: Long) {} // Noop default implementation to avoid breaking change
3535

3636
/**
3737
* Called when the children of a node have changed.

0 commit comments

Comments
 (0)