Class NaiveMovedArtifactDetection<L extends Label>
java.lang.Object
org.variantsync.diffdetective.variation.diff.transform.NaiveMovedArtifactDetection<L>
- All Implemented Interfaces:
VariationDiffTransformer<L>
public class NaiveMovedArtifactDetection<L extends Label>
extends Object
implements VariationDiffTransformer<L>
Finds artifact nodes whose label is exactly equal. If one of those nodes was added and the other one was removed,
NaiveMovedArtifactDetection merges them and interprets this edit as a move instead of separate insertion and deletion.
A possible future extension would be to account for multiline artifact nodes to not only check for exact equality of text
but for each line in the nodes individually.
- Author:
- Paul Bittner
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfindArtifactTwins
(VariationDiff<L> variationDiff) findTwinOf
(DiffNode<L> artifact, List<DiffNode<L>> artifactNodes) void
transform
(VariationDiff<L> variationDiff) Apply a transformation to the given VariationDiff inplace.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.variantsync.diffdetective.variation.diff.transform.VariationDiffTransformer
getDependencies
-
Constructor Details
-
NaiveMovedArtifactDetection
public NaiveMovedArtifactDetection()
-
-
Method Details
-
transform
Description copied from interface:VariationDiffTransformer
Apply a transformation to the given VariationDiff inplace. The given tree will be changed.- Specified by:
transform
in interfaceVariationDiffTransformer<L extends Label>
- Parameters:
variationDiff
- The VariationDiff to transform.
-
findArtifactTwins
private static <L extends Label> List<org.variantsync.functjonal.Pair<DiffNode<L>,DiffNode<L>>> findArtifactTwins(VariationDiff<L> variationDiff) -
findTwinOf
-
merge
-