From: Julien HENRY Date: Wed, 9 Oct 2013 07:36:50 +0000 (+0200) Subject: Fix some quality flaws X-Git-Tag: 4.0~199 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=e7ba0bb850590959c0d39decb711d0d482228f1b;p=sonarqube.git Fix some quality flaws --- 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 notifications = notificationQueueDao.findOldest(batchSize); - if (notifications.isEmpty()) { + List notificationDtos = notificationQueueDao.findOldest(batchSize); + if (notificationDtos.isEmpty()) { return null; } - notificationQueueDao.delete(notifications); + notificationQueueDao.delete(notificationDtos); + return convertToNotification(notificationDtos); + } + + private Notification convertToNotification(List notifications) { try { // If batchSize is increased then we should return a list instead of a single element return notifications.get(0).toNotification();