aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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();