diff options
author | Julien Lancelot <julien.lancelot@gmail.com> | 2013-04-19 12:12:56 +0200 |
---|---|---|
committer | Julien Lancelot <julien.lancelot@gmail.com> | 2013-04-19 12:12:56 +0200 |
commit | 3efb07528d4eb835a61faf35f3f02f2e3edc974d (patch) | |
tree | b753ac8715649d35a5c318490ce1f493aa86d6a3 | |
parent | 828fb94ce229e3f67f9886ac57b505a08af7db0a (diff) | |
download | sonarqube-3efb07528d4eb835a61faf35f3f02f2e3edc974d.tar.gz sonarqube-3efb07528d4eb835a61faf35f3f02f2e3edc974d.zip |
SONAR-3755 Small code simplification
-rw-r--r-- | plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/issue/IssueTracking.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/issue/IssueTracking.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/issue/IssueTracking.java index 1f9e4233091..a131eee7848 100644 --- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/issue/IssueTracking.java +++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/issue/IssueTracking.java @@ -48,8 +48,9 @@ public class IssueTracking implements BatchExtension { private static final Comparator<LinePair> LINE_PAIR_COMPARATOR = new Comparator<LinePair>() { public int compare(LinePair o1, LinePair o2) { - if (o2.weight - o1.weight != 0) { - return o2.weight - o1.weight; + int weightDiff = o2.weight - o1.weight; + if (weightDiff != 0) { + return weightDiff; } else { return Math.abs(o1.lineA -o1.lineB) - Math.abs(o2.lineA - o2.lineB); } |