]> source.dussan.org Git - sonarqube.git/commit
SONAR-12449 fix code move issue tracking missing some random issues
authorSébastien Lesaint <sebastien.lesaint@sonarsource.com>
Wed, 4 Sep 2019 09:22:51 +0000 (11:22 +0200)
committerSonarTech <sonartech@sonarsource.com>
Wed, 18 Sep 2019 07:51:47 +0000 (09:51 +0200)
commit541199e925328f61eb773430686cd4e26f056273
tree4adfd6c31d05194650d7ef0acc59f742a09e22a9
parent2be53fd8bc0bff878bd4c7daebbca61720aee9c2
SONAR-12449 fix code move issue tracking missing some random issues

an initial piece of code of code move heuristic would index issues by line in a MultiMap
issues are DefaultIssue objects which hashCode method is based solely on DefaultIssue's key field
Multimap implementation used in code move was Set based
unfortunately, at this point in time, no DefaultIssue instance have a key set yet
which implies that all of them have the same hashcode
which implies when stored in the MultiMap for the same key, only one DefaultIssue instance was stored (the first added, which is unpredictable)
this change make code move heuristic use List based Multimaps which do not use DefaultIssue's hashcode
sonar-core/src/main/java/org/sonar/core/issue/tracking/BlockRecognizer.java