summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@sonarsource.com>2015-08-31 16:42:05 +0200
committerJulien Lancelot <julien.lancelot@sonarsource.com>2015-08-31 16:42:05 +0200
commit75b201a54a3cc80f035e6f177f907eb04bd8f892 (patch)
tree66a40a5d37fcd8ac9c9a7c138182a876b7496509
parent29814478d54b8e74d4ed2450a01c4123333fee2d (diff)
downloadsonarqube-75b201a54a3cc80f035e6f177f907eb04bd8f892.tar.gz
sonarqube-75b201a54a3cc80f035e6f177f907eb04bd8f892.zip
Fix quality flaw
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/duplication/ws/DuplicationsParser.java22
1 files changed, 11 insertions, 11 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/duplication/ws/DuplicationsParser.java b/server/sonar-server/src/main/java/org/sonar/server/duplication/ws/DuplicationsParser.java
index 5cb81834cce..e050769bd01 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/duplication/ws/DuplicationsParser.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/duplication/ws/DuplicationsParser.java
@@ -115,8 +115,7 @@ public class DuplicationsParser {
}
@Override
- public int compare(@Nullable Duplication d1,
- @Nullable Duplication d2) {
+ public int compare(@Nullable Duplication d1, @Nullable Duplication d2) {
if (d1 == null || d2 == null) {
return -1;
}
@@ -126,25 +125,27 @@ public class DuplicationsParser {
if (file1 == null || file2 == null) {
return -1;
}
-
if (file1.equals(d2.file())) {
// if duplication on same file => order by starting line
return d1.from().compareTo(d2.from());
- } else if (file1.uuid().equals(uuid)) {
+ }
+ if (file1.uuid().equals(uuid)) {
// the current resource must be displayed first
return -1;
- } else if (file2.uuid().equals(uuid)) {
+ }
+ if (file2.uuid().equals(uuid)) {
// the current resource must be displayed first
return 1;
- } else if (StringUtils.equals(file1.projectUuid(), projectUuid) && !StringUtils.equals(file2.projectUuid(), projectUuid)) {
+ }
+ if (StringUtils.equals(file1.projectUuid(), projectUuid) && !StringUtils.equals(file2.projectUuid(), projectUuid)) {
// if resource is in the same project, this it must be displayed first
return -1;
- } else if (StringUtils.equals(file2.projectUuid(), projectUuid) && !StringUtils.equals(file1.projectUuid(), projectUuid)) {
+ }
+ if (StringUtils.equals(file2.projectUuid(), projectUuid) && !StringUtils.equals(file1.projectUuid(), projectUuid)) {
// if resource is in the same project, this it must be displayed first
return 1;
- } else {
- return d1.from().compareTo(d2.from());
}
+ return d1.from().compareTo(d2.from());
}
}
@@ -152,8 +153,7 @@ public class DuplicationsParser {
private static final long serialVersionUID = 1;
@Override
- public int compare(@Nullable Block b1,
- @Nullable Block b2) {
+ public int compare(@Nullable Block b1, @Nullable Block b2) {
if (b1 == null || b2 == null) {
return -1;
}