Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong pair order in SimpleBugIntroducerFinder #38

Open
markus7800 opened this issue Jan 18, 2022 · 0 comments · May be fixed by #39
Open

Wrong pair order in SimpleBugIntroducerFinder #38

markus7800 opened this issue Jan 18, 2022 · 0 comments · May be fixed by #39

Comments

@markus7800
Copy link

markus7800 commented Jan 18, 2022

It seems to me that in the following code snippet

for (Map.Entry<String, List<String>> entry : bucketIntroducers.entrySet()) {
List<String> introducers = entry.getValue();
List<String> issues = bucketIssues.get(entry.getKey());
RevisionCombinationGenerator gen = new RevisionCombinationGenerator(introducers, issues, 2);
gen = gen.iterator();
while(gen.hasNext()) {
String[] pair = gen.getNextIndic();
if (pair[0] == "" && pair[1] == "")
continue;
if (isWithinTimeframe(pair[1], pair[0])) {
bugIntroducers.add(pair);
} else {
if (!partialIntroducers.containsKey(entry.getKey())) {
partialIntroducers.put(entry.getKey(), new ArrayList<>());
}
partialIntroducers.get(entry.getKey()).add(pair[0]);
if (!partialIssues.containsKey(entry.getKey())) {
partialIssues.put(entry.getKey(), new ArrayList<>());
}
partialIssues.get(entry.getKey()).add(pair[1]);
}
}
}

pair[0] is a bug-introducing commit, and pair[1] is a bug-fixing commit as defined in the issue list.

However, in line 193 (as well as in line 224), I think the order of the pair should be (bug-fixing commit, bug-introducing commit), so (pair[1], pair[0]).

Is this correct or am I missing something?

@markus7800 markus7800 linked a pull request Jan 18, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant