Skip to content

Commit

Permalink
ASTDiff: Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pouryafard75 committed Mar 22, 2024
1 parent aa52030 commit eeb9ddb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class MissingIdenticalSubtree extends GreedySubtreeMatcher implements Tre
protected Tree src;
protected Tree dst;
protected ExtendedMultiMappingStore mappings;

@Override
public void match(Tree src, Tree dst, ExtendedMultiMappingStore mappingStore) {
this.src = src;
Expand Down Expand Up @@ -66,7 +66,9 @@ public void match(Tree src, Tree dst, ExtendedMultiMappingStore mappingStore) {
public void filterMappings(MultiMappingStore multiMappings) {
List<Mapping> ambiguousList = new ArrayList<>();
Set<Tree> ignored = new HashSet<>();
for (var src : multiMappings.allMappedSrcs()) {
Set<Tree> trees = new TreeSet<>(Comparator.comparingInt(Tree::getPos));
trees.addAll(multiMappings.allMappedSrcs());
for (var src : trees) {
var isMappingUnique = false;
if (tinyTrees(src,multiMappings,minPriority))
continue;
Expand All @@ -91,7 +93,7 @@ public void filterMappings(MultiMappingStore multiMappings) {
}
Set<Tree> srcIgnored = new HashSet<>();
Set<Tree> dstIgnored = new HashSet<>();
Collections.sort(ambiguousList, new MappingComparators.FullMappingComparator(mappings.getMonoMappingStore()));
Collections.sort(ambiguousList, new CustomTopDownMatcher.ExtendedFullMappingComparator(mappings.getMonoMappingStore()));
// Select the best ambiguous mappings
retainBestMapping(ambiguousList, srcIgnored, dstIgnored);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ public class RefactoringOracleProblematicCasesTest {
@ParameterizedTest(name= "{index}: {0}")
@JsonFileSource(resources = {"/astDiff/commits/cases-problematic.json"})
public void testSubTreeMappings(@ConvertWith(CaseInfo.CaseInfoConverter.class) CaseInfo info) throws Exception {
//TODO : Fix the flakiness for this case
if (info.makeURL().equals("https://github.com/infinispan/infinispan/commit/03573a655bcbb77f7a76d8e22d851cc22796b4f8")) return;

File mappingsDirFile = new File(getFinalFolderPath(dir, info.getRepo(), info.getCommit()));
String[] files = mappingsDirFile.list();
List<String> expectedFilesList = new ArrayList<>(List.of(Objects.requireNonNull(files)));
Expand Down

0 comments on commit eeb9ddb

Please sign in to comment.