Class NaiveMovedArtifactDetection<L extends Label>
java.lang.Object
org.variantsync.diffdetective.variation.diff.transform.NaiveMovedArtifactDetection<L>
- All Implemented Interfaces:
Transformer<VariationDiff<L>>
public class NaiveMovedArtifactDetection<L extends Label>
extends Object
implements Transformer<VariationDiff<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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfindArtifactTwins(VariationDiff<L> variationDiff) findTwinOf(DiffNode<L> artifact, List<DiffNode<L>> artifactNodes) voidtransform(VariationDiff<L> variationDiff) Apply a transformation to the given Object inplace.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.variantsync.diffdetective.variation.diff.transform.Transformer
getDependencies
-
Constructor Details
-
NaiveMovedArtifactDetection
public NaiveMovedArtifactDetection()
-
-
Method Details
-
transform
Description copied from interface:TransformerApply a transformation to the given Object inplace. The object will be changed.- Specified by:
transformin interfaceTransformer<L extends Label>- Parameters:
variationDiff- The T object to transform.
-
findArtifactTwins
private static <L extends Label> List<org.variantsync.functjonal.Pair<DiffNode<L>,DiffNode<L>>> findArtifactTwins(VariationDiff<L> variationDiff) -
findTwinOf
-
merge
-