diff options
author | Julien HENRY <julien.henry@sonarsource.com> | 2016-05-10 17:23:32 +0200 |
---|---|---|
committer | Julien HENRY <julien.henry@sonarsource.com> | 2016-05-11 18:04:42 +0200 |
commit | a26c8cf3d00955a807ade179d24e68b66aaf669f (patch) | |
tree | 0e879093792c548da416f1af969388598610cb38 /plugins | |
parent | 1d8796ed0044630a2c7d9b985767087af2b6caac (diff) | |
download | sonarqube-a26c8cf3d00955a807ade179d24e68b66aaf669f.tar.gz sonarqube-a26c8cf3d00955a807ade179d24e68b66aaf669f.zip |
SONAR-6897 add IT
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/scm/XooBlameCommand.java | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/scm/XooBlameCommand.java b/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/scm/XooBlameCommand.java index 4f5d0e6b169..aa5b3a7e214 100644 --- a/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/scm/XooBlameCommand.java +++ b/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/scm/XooBlameCommand.java @@ -24,6 +24,7 @@ import java.io.File; import java.io.IOException; import java.nio.charset.StandardCharsets; import java.util.ArrayList; +import java.util.Date; import java.util.List; import org.apache.commons.io.FileUtils; import org.apache.commons.lang.StringUtils; @@ -67,9 +68,14 @@ public class XooBlameCommand extends BlameCommand { String author = StringUtils.trimToNull(fields[1]); BlameLine blameLine = new BlameLine().revision(revision).author(author); String dateStr = StringUtils.trimToNull(fields[2]); - // Will throw an exception, when date is not in format "yyyy-MM-dd" if (dateStr != null) { - blameLine.date(DateUtils.parseDate(dateStr)); + Date dateTime = DateUtils.parseDateTimeQuietly(dateStr); + if (dateTime != null) { + blameLine.date(dateTime); + } else { + // Will throw an exception, when date is not in format "yyyy-MM-dd" + blameLine.date(DateUtils.parseDate(dateStr)); + } } blame.add(blameLine); } |