Skip to content

Commit

Permalink
feat: gumtree simple is now the default matcher.
Browse files Browse the repository at this point in the history
  • Loading branch information
jrfaller committed Jan 31, 2024
1 parent 8ffbeec commit 8406ba3
Showing 1 changed file with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
package com.github.gumtreediff.matchers;

import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

Expand All @@ -39,7 +40,6 @@
import com.github.gumtreediff.matchers.optimizations.LeafMoveMatcherThetaE;
import com.github.gumtreediff.matchers.optimizations.UnmappedLeavesMatcherThetaC;
import com.github.gumtreediff.tree.Tree;
import com.google.common.collect.Sets;

/**
* A class defining the CompositeMatcher class, which is a pipeline of matchers.
Expand Down Expand Up @@ -73,28 +73,28 @@ public List<Matcher> matchers() {

@Override
public Set<ConfigurationOptions> getApplicableOptions() {
Set<ConfigurationOptions> allOptions = Sets.newHashSet();
Set<ConfigurationOptions> allOptions = new HashSet<>();
for (Matcher matcher : matchers)
allOptions.addAll(matcher.getApplicableOptions());

return allOptions;
}
}

@Register(id = "gumtree", priority = Registry.Priority.MAXIMUM)
public static class ClassicGumtree extends CompositeMatcher {
public ClassicGumtree() {
super(new GreedySubtreeMatcher(), new GreedyBottomUpMatcher());
}
}

@Register(id = "gumtree-simple", priority = Registry.Priority.HIGH)
public static class SimpleGumtree extends CompositeMatcher {
public SimpleGumtree() {
super(new GreedySubtreeMatcher(), new SimpleBottomUpMatcher());
}
}

@Register(id = "gumtree-classic", priority = Registry.Priority.HIGH)
public static class ClassicGumtree extends CompositeMatcher {
public ClassicGumtree() {
super(new GreedySubtreeMatcher(), new GreedyBottomUpMatcher());
}
}

@Register(id = "gumtree-simple-stable", priority = Registry.Priority.HIGH)
public static class SimpleGumtreeStable extends CompositeMatcher {
public SimpleGumtreeStable() {
Expand Down

0 comments on commit 8406ba3

Please sign in to comment.