Class CutNonEditedSubtrees<L extends Label>
java.lang.Object
org.variantsync.diffdetective.variation.diff.transform.CutNonEditedSubtrees<L>
- All Implemented Interfaces:
Transformer<VariationDiff<L>>,VariationDiffVisitor<L>
public class CutNonEditedSubtrees<L extends Label>
extends Object
implements Transformer<VariationDiff<L>>, VariationDiffVisitor<L>
This transformer removes all subtrees from a VariationDiff that are non-edited.
A subtree is unedited, if all nodes in it are unchanged and all nodes have the same
before and after parent.
Such subtrees just model state but not an edit and thus are removed from the validation
of our edit classes in our ESEC/FSE'22 paper.
- Author:
- Paul Bittner
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <L extends Label>
voidgenericTransform(boolean keepDummy, VariationDiff<L> variationDiff) static <L extends Label>
voidgenericTransform(VariationDiff<L> variationDiff) toString()voidtransform(VariationDiff<L> variationDiff) Apply a transformation to the given Object inplace.voidvisit(VariationDiffTraversal<L> traversal, DiffNode<L> subtree) Invoked by a traversal when a node is visited.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.variantsync.diffdetective.variation.diff.transform.Transformer
getDependencies
-
Field Details
-
keepDummy
private final boolean keepDummy
-
-
Constructor Details
-
CutNonEditedSubtrees
public CutNonEditedSubtrees(boolean keepDummy) - Parameters:
keepDummy- The transformation will keep the root of any removed subtree if this is true. Otherwise the entire subtree is removed. Default is false inCutNonEditedSubtrees().
-
CutNonEditedSubtrees
public CutNonEditedSubtrees()
-
-
Method Details
-
genericTransform
-
genericTransform
public static <L extends Label> void genericTransform(boolean keepDummy, VariationDiff<L> variationDiff) -
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.
-
visit
Description copied from interface:VariationDiffVisitorInvoked by a traversal when a node is visited. The traversal might be continued by invoking respective methods on the given traversal object again. However, any node that was already visited, will not be visited again.- Specified by:
visitin interfaceVariationDiffVisitor<L extends Label>- Parameters:
traversal- The current traversal. May be instructed on how to continue traversal.subtree- The node that is currently visited.- See Also:
-
toString
-