Skip to content

Commit 4624ef9

Browse files
fix: only ignore PC changes of artifacts
The extraction should have worked as intended before, because we discard PCs of other nodes in any case. However, it might cause problems in the future.
1 parent 206254f commit 4624ef9

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/main/java/org/variantsync/vevos/extraction/PCAnalysis.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ static void analyzeNode(FileGT.Mutable fileGT, DiffNode<DiffLinesLabel> node, Ti
3030
Node featureMapping;
3131
Node presenceCondition;
3232

33-
if (ignorePCChanges && node.diffType == DiffType.NON) {
33+
if (node.isArtifact() && ignorePCChanges && node.diffType == DiffType.NON) {
34+
// If an artifact is unchanged but has a new PC, we ignore the change by assigning it the same PC before and after
35+
// which is the PC before the change
3436
featureMapping = node.getFeatureMapping(Time.BEFORE).toCNF(false);
3537
presenceCondition = node.getPresenceCondition(Time.BEFORE).toCNF(false);
3638
} else {
@@ -58,7 +60,7 @@ static void analyzeNode(FileGT.Mutable fileGT, DiffNode<DiffLinesLabel> node, Ti
5860
int fromLine = currentRange.fromInclusive();
5961
int toLine = currentRange.toExclusive();
6062
// Also consider the #endif in case of an annotation
61-
toLine = (node.isAnnotation() && !node.isRoot()) ? toLine+1 : toLine;
63+
toLine = (node.isAnnotation() && !node.isRoot()) ? toLine + 1 : toLine;
6264

6365
// Grow the root mapping
6466
fileGT.growIfRequired(toLine);

0 commit comments

Comments
 (0)