|
3 | 3 | import org.variantsync.diffdetective.diff.difftree.DiffNode; |
4 | 4 | import org.variantsync.diffdetective.diff.difftree.LineGraphConstants; |
5 | 5 | import org.variantsync.diffdetective.diff.difftree.serialize.LinegraphFormat; |
| 6 | +import org.variantsync.diffdetective.util.Assert; |
6 | 7 | import org.variantsync.diffdetective.util.StringUtils; |
7 | 8 | import org.variantsync.functjonal.Pair; |
8 | 9 |
|
@@ -49,14 +50,14 @@ public Direction getEdgeDirection() { |
49 | 50 | protected void connectAccordingToLabel(final DiffNode child, final DiffNode parent, final String edgeLabel) { |
50 | 51 | if (edgeLabel.startsWith(LineGraphConstants.BEFORE_AND_AFTER_PARENT)) { |
51 | 52 | // Nothing has been changed. The child-parent relationship remains the same |
52 | | - parent.addAfterChild(child); |
53 | | - parent.addBeforeChild(child); |
| 53 | + Assert.assertTrue(parent.addAfterChild(child)); |
| 54 | + Assert.assertTrue(parent.addBeforeChild(child)); |
54 | 55 | } else if (edgeLabel.startsWith(LineGraphConstants.BEFORE_PARENT)) { |
55 | 56 | // The child DiffNode lost its parent DiffNode (an orphan DiffNode) |
56 | | - parent.addBeforeChild(child); |
| 57 | + Assert.assertTrue(parent.addBeforeChild(child)); |
57 | 58 | } else if (edgeLabel.startsWith(LineGraphConstants.AFTER_PARENT)) { |
58 | 59 | // The parent DiffNode has a new child DiffNode |
59 | | - parent.addAfterChild(child); |
| 60 | + Assert.assertTrue(parent.addAfterChild(child)); |
60 | 61 | } else { |
61 | 62 | throw new IllegalArgumentException("Syntax error. Invalid name in edge label " + edgeLabel); |
62 | 63 | } |
|
0 commit comments