Skip to content

Commit f1653a0

Browse files
committed
bugfix: unique ids for parsed DiffNodes from release formats
1 parent 727ecee commit f1653a0

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/main/java/org/variantsync/diffdetective/mining/formats/MiningNodeFormat.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,16 @@
1111
public interface MiningNodeFormat extends DiffNodeLabelFormat {
1212
Pair<DiffType, CodeType> fromEncodedTypes(final String tag);
1313

14+
@Override
1415
default DiffNode fromLabelAndId(String lineGraphNodeLabel, int nodeId) {
1516
/// We cannot reuse the id as it is just a sequential integer. It thus, does not contain any information.
16-
final DiffLineNumber lineFrom = DiffLineNumber.Invalid();
17-
final DiffLineNumber lineTo = DiffLineNumber.Invalid();
17+
final DiffLineNumber lineFrom = new DiffLineNumber(nodeId, nodeId, nodeId);
18+
final DiffLineNumber lineTo = new DiffLineNumber(nodeId, nodeId, nodeId);
1819
final String resultLabel = "";
1920

2021
final Pair<DiffType, CodeType> types = fromEncodedTypes(lineGraphNodeLabel);
22+
lineFrom.as(types.first());
23+
lineTo.as(types.first());
2124
if (types.second() == CodeType.CODE) {
2225
return DiffNode.createCode(types.first(),
2326
lineFrom, lineTo, resultLabel);

0 commit comments

Comments
 (0)