aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulien HENRY <julien.henry@sonarsource.com>2013-10-09 09:36:50 +0200
committerJulien HENRY <julien.henry@sonarsource.com>2013-10-09 09:37:20 +0200
commite7ba0bb850590959c0d39decb711d0d482228f1b (patch)
treea517c7f78d0f406c9289e4315fa562ba8e53aa41
parent94ef614e66a44fdb6074288b0b04f845cb8558d5 (diff)
downloadsonarqube-e7ba0bb850590959c0d39decb711d0d482228f1b.tar.gz
sonarqube-e7ba0bb850590959c0d39decb711d0d482228f1b.zip
Fix some quality flaws
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/scan/filesystem/FileHashCache.java1
-rw-r--r--sonar-core/src/main/java/org/sonar/core/notification/DefaultNotificationManager.java10
2 files changed, 8 insertions, 3 deletions
diff --git a/sonar-batch/src/main/java/org/sonar/batch/scan/filesystem/FileHashCache.java b/sonar-batch/src/main/java/org/sonar/batch/scan/filesystem/FileHashCache.java
index 69309908449..c17733c7be9 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/scan/filesystem/FileHashCache.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/scan/filesystem/FileHashCache.java
@@ -110,5 +110,6 @@ public class FileHashCache implements BatchComponent, Startable {
@Override
public void stop() {
+ // Nothing to do
}
}
diff --git a/sonar-core/src/main/java/org/sonar/core/notification/DefaultNotificationManager.java b/sonar-core/src/main/java/org/sonar/core/notification/DefaultNotificationManager.java
index 1dc95619947..8428b98d049 100644
--- a/sonar-core/src/main/java/org/sonar/core/notification/DefaultNotificationManager.java
+++ b/sonar-core/src/main/java/org/sonar/core/notification/DefaultNotificationManager.java
@@ -96,12 +96,16 @@ public class DefaultNotificationManager implements NotificationManager {
*/
public Notification getFromQueue() {
int batchSize = 1;
- List<NotificationQueueDto> notifications = notificationQueueDao.findOldest(batchSize);
- if (notifications.isEmpty()) {
+ List<NotificationQueueDto> notificationDtos = notificationQueueDao.findOldest(batchSize);
+ if (notificationDtos.isEmpty()) {
return null;
}
- notificationQueueDao.delete(notifications);
+ notificationQueueDao.delete(notificationDtos);
+ return convertToNotification(notificationDtos);
+ }
+
+ private Notification convertToNotification(List<NotificationQueueDto> notifications) {
try {
// If batchSize is increased then we should return a list instead of a single element
return notifications.get(0).toNotification();