]> source.dussan.org Git - sonarqube.git/commitdiff
Fix quality flaw
authorSimon Brandhof <simon.brandhof@sonarsource.com>
Fri, 25 Sep 2015 15:38:47 +0000 (17:38 +0200)
committerSimon Brandhof <simon.brandhof@sonarsource.com>
Fri, 25 Sep 2015 15:38:58 +0000 (17:38 +0200)
due to @CheckForNull that was recently added to DateUtils.parseDateTimeQuietly()

sonar-db/src/main/java/org/sonar/db/version/v51/FeedFileSourcesBinaryData.java

index 9b9ea0560148befa01fcd9c6bb18e91048a7cdc1..0b881b7a0106295cefad77400689b6973fe2f3f3 100644 (file)
@@ -23,6 +23,7 @@ import com.google.common.base.Function;
 import com.google.common.base.Splitter;
 import com.google.common.collect.Iterables;
 import java.sql.SQLException;
+import java.util.Date;
 import java.util.Iterator;
 import javax.annotation.Nonnull;
 import javax.annotation.Nullable;
@@ -84,9 +85,9 @@ public class FeedFileSourcesBinaryData extends BaseDataChange {
             if (StringUtils.isNotEmpty(s)) {
               lineBuilder.setScmAuthor(s);
             }
-            s = row.get(2);
-            if (StringUtils.isNotEmpty(s)) {
-              lineBuilder.setScmDate(DateUtils.parseDateTimeQuietly(s).getTime());
+            Date scmDate = DateUtils.parseDateTimeQuietly(row.get(2));
+            if (scmDate != null) {
+              lineBuilder.setScmDate(scmDate.getTime());
             }
             s = row.get(3);
             if (StringUtils.isNotEmpty(s)) {