From a26c8cf3d00955a807ade179d24e68b66aaf669f Mon Sep 17 00:00:00 2001 From: Julien HENRY Date: Tue, 10 May 2016 17:23:32 +0200 Subject: SONAR-6897 add IT --- .../src/main/java/org/sonar/xoo/scm/XooBlameCommand.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'plugins') 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); } -- cgit v1.2.3