Commit 7043fae
committed
Refactor Starfold to adhere to DiffNode's invariants
The time specific children of `DiffNode` do not guarantee any ordering,
but the Starfold transformation requires these nodes to be ordered:
- When `respectNodeOrder` is active.
- For the label of the merged node, which is composed sequentially from
the merged nodes in the order of the given children.
For that reason Starfold cannot use `DiffNode.getChildren` and has to
use `DiffNode.getAllChildren` instead. Because this list contains both
/before/ and /after/ children the actual computation has to filter the
children to a specific time.
It would also be possible to run the two cases (/before/ and /after/) in
parallel, but this a consumer with the semantic of a coroutine and a
finalisation step to merge the remaining nodes. But this introduces
complexity which doesn't seem adequate.1 parent 3cb5ec8 commit 7043fae
2 files changed
Lines changed: 17 additions & 3 deletions
File tree
- src/main/java/org/variantsync/diffdetective/diff/difftree
- transform
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
644 | 644 | | |
645 | 645 | | |
646 | 646 | | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
647 | 659 | | |
648 | 660 | | |
649 | 661 | | |
| |||
Lines changed: 5 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
51 | | - | |
52 | 50 | | |
53 | 51 | | |
54 | | - | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
55 | 57 | | |
56 | 58 | | |
57 | 59 | | |
| |||
0 commit comments