diff options
author | Sébastien Lesaint <sebastien.lesaint@sonarsource.com> | 2015-12-18 10:00:18 +0100 |
---|---|---|
committer | Sébastien Lesaint <sebastien.lesaint@sonarsource.com> | 2015-12-18 10:00:18 +0100 |
commit | daf70b2c4c8b962179ecdeec24a8ea5e07e307af (patch) | |
tree | 7b32851ac2f59f48cf1252092263fc19957e5091 /server | |
parent | feb13a2e4ab1234dc8f11c10efe692c96bf418ee (diff) | |
download | sonarqube-daf70b2c4c8b962179ecdeec24a8ea5e07e307af.tar.gz sonarqube-daf70b2c4c8b962179ecdeec24a8ea5e07e307af.zip |
fix quality flaws
Diffstat (limited to 'server')
4 files changed, 9 insertions, 6 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/duplication/DuplicationRepositoryImpl.java b/server/sonar-server/src/main/java/org/sonar/server/computation/duplication/DuplicationRepositoryImpl.java index 8659661d5fc..f8823915258 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/computation/duplication/DuplicationRepositoryImpl.java +++ b/server/sonar-server/src/main/java/org/sonar/server/computation/duplication/DuplicationRepositoryImpl.java @@ -39,11 +39,11 @@ public class DuplicationRepositoryImpl implements DuplicationRepository { public Iterable<Duplication> getDuplications(Component file) { checkFileComponentArgument(file); - Collection<Duplication> duplications = this.duplications.asMap().get(file.getKey()); - if (duplications == null) { + Collection<Duplication> res = this.duplications.asMap().get(file.getKey()); + if (res == null) { return Collections.emptyList(); } - return duplications; + return res; } @Override diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/duplication/IntegrateCrossProjectDuplications.java b/server/sonar-server/src/main/java/org/sonar/server/computation/duplication/IntegrateCrossProjectDuplications.java index 2b2291a8685..3eaef29ef45 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/computation/duplication/IntegrateCrossProjectDuplications.java +++ b/server/sonar-server/src/main/java/org/sonar/server/computation/duplication/IntegrateCrossProjectDuplications.java @@ -173,7 +173,9 @@ public class IntegrateCrossProjectDuplications { LOGGER.warn("Too many duplication references on file {} for block at line {}. Keeping only the first {} references.", file.getKey(), originPart.getStartLine(), MAX_CLONE_PART_PER_GROUP); } - return counter++ <= MAX_CLONE_GROUP_PER_FILE; + boolean res = counter <= MAX_CLONE_GROUP_PER_FILE; + counter++; + return res; } } diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/queue/CeQueueImpl.java b/server/sonar-server/src/main/java/org/sonar/server/computation/queue/CeQueueImpl.java index eee80fa2bb2..0021bbbea03 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/computation/queue/CeQueueImpl.java +++ b/server/sonar-server/src/main/java/org/sonar/server/computation/queue/CeQueueImpl.java @@ -191,7 +191,7 @@ public class CeQueueImpl implements CeQueue { } } - private void updateTaskResult(CeActivityDto activityDto, @Nullable CeTaskResult taskResult) { + private static void updateTaskResult(CeActivityDto activityDto, @Nullable CeTaskResult taskResult) { if (taskResult != null) { Long snapshotId = taskResult.getSnapshotId(); if (snapshotId != null) { diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/step/LoadDuplicationsFromReportStep.java b/server/sonar-server/src/main/java/org/sonar/server/computation/step/LoadDuplicationsFromReportStep.java index 540fc96fa07..63d0fbcfb6a 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/computation/step/LoadDuplicationsFromReportStep.java +++ b/server/sonar-server/src/main/java/org/sonar/server/computation/step/LoadDuplicationsFromReportStep.java @@ -70,7 +70,8 @@ public class LoadDuplicationsFromReportStep implements ComputationStep { try { int idGenerator = 1; while (duplications.hasNext()) { - loadDuplications(file, duplications.next(), idGenerator++); + loadDuplications(file, duplications.next(), idGenerator); + idGenerator++; } } finally { duplications.close(); |