]> source.dussan.org Git - sonarqube.git/commitdiff
Fix some quality flaws
authorJulien HENRY <julien.henry@sonarsource.com>
Wed, 9 Oct 2013 07:36:50 +0000 (09:36 +0200)
committerJulien HENRY <julien.henry@sonarsource.com>
Wed, 9 Oct 2013 07:37:20 +0000 (09:37 +0200)
sonar-batch/src/main/java/org/sonar/batch/scan/filesystem/FileHashCache.java
sonar-core/src/main/java/org/sonar/core/notification/DefaultNotificationManager.java

index 69309908449cb048b8811594d8b97ac31624c0c8..c17733c7be9adb8155796a98ea6ec9568040378c 100644 (file)
@@ -110,5 +110,6 @@ public class FileHashCache implements BatchComponent, Startable {
 
   @Override
   public void stop() {
+    // Nothing to do
   }
 }
index 1dc95619947eb70d71c7625a6c7335c78fd60711..8428b98d049f34cfec624b476d0091faee5a0280 100644 (file)
@@ -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();