Skip to content

Commit ebaee18

Browse files
committed
ASTDiff: Ignore comments in optimization phase
1 parent e488d7b commit ebaee18

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/org/refactoringminer/astDiff/matchers/wrappers/ASTDiffMappingOptimizer.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import com.github.gumtreediff.tree.TreeContext;
55
import gr.uom.java.xmi.LocationInfo;
66
import gr.uom.java.xmi.decomposition.AbstractCodeMapping;
7+
import org.refactoringminer.astDiff.matchers.statement.IgnoringCommentsLeafMatcher;
78
import org.refactoringminer.astDiff.matchers.statement.LeafMatcher;
89
import org.refactoringminer.astDiff.models.ASTDiff;
910
import org.refactoringminer.astDiff.models.ExtendedMultiMappingStore;
@@ -61,7 +62,7 @@ private static void processOptimization(ASTDiff input, OptimizationData optimiza
6162
Tree dstExp = TreeUtilFunctions.findByLocationInfo(dstTree, lastStepMapping.getFragment2().getLocationInfo());
6263
if (srcExp == null || dstExp == null) continue;
6364
if (needToOverride(input, srcExp, dstExp))
64-
new LeafMatcher().match(srcExp, dstExp, lastStepMappingStore);
65+
new IgnoringCommentsLeafMatcher().match(srcExp, dstExp, lastStepMappingStore);
6566
else
6667
new LeafMatcher().match(srcExp,dstExp,input.getAllMappings());
6768
}

0 commit comments

Comments
 (0)