Skip to content

Wrong pair order in SimpleBugIntroducerFinder #38

@markus7800

Description

@markus7800

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions