diff options
author | Julien HENRY <julien.henry@sonarsource.com> | 2015-03-16 14:19:55 +0100 |
---|---|---|
committer | Julien HENRY <julien.henry@sonarsource.com> | 2015-03-16 14:28:41 +0100 |
commit | 46e1d76cc3814518f23b65132e5a8f083bb707a5 (patch) | |
tree | 515578f952a328da19a653d425850a5807d53464 /sonar-plugin-api/src | |
parent | 008f29b5613739b2da1db8596bc92f103eca427e (diff) | |
download | sonarqube-46e1d76cc3814518f23b65132e5a8f083bb707a5.tar.gz sonarqube-46e1d76cc3814518f23b65132e5a8f083bb707a5.zip |
Remove use of DateUtils.truncate since it is not efficient
Diffstat (limited to 'sonar-plugin-api/src')
-rw-r--r-- | sonar-plugin-api/src/main/java/org/sonar/api/issue/internal/DefaultIssue.java | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/issue/internal/DefaultIssue.java b/sonar-plugin-api/src/main/java/org/sonar/api/issue/internal/DefaultIssue.java index 05d5d0fc5bd..04051ae4527 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/issue/internal/DefaultIssue.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/issue/internal/DefaultIssue.java @@ -29,7 +29,6 @@ import com.google.common.collect.Maps; import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.builder.ToStringBuilder; import org.apache.commons.lang.builder.ToStringStyle; -import org.apache.commons.lang.time.DateUtils; import org.sonar.api.issue.Issue; import org.sonar.api.issue.IssueComment; import org.sonar.api.rule.RuleKey; @@ -334,8 +333,7 @@ public class DefaultIssue implements Issue { } public DefaultIssue setCreationDate(Date d) { - // d is not marked as Nullable but we still allow null parameter for unit testing. - this.creationDate = (d != null ? DateUtils.truncate(d, Calendar.SECOND) : null); + this.creationDate = d; return this; } @@ -346,7 +344,7 @@ public class DefaultIssue implements Issue { } public DefaultIssue setUpdateDate(@Nullable Date d) { - this.updateDate = (d != null ? DateUtils.truncate(d, Calendar.SECOND) : null); + this.updateDate = d; return this; } @@ -357,7 +355,7 @@ public class DefaultIssue implements Issue { } public DefaultIssue setCloseDate(@Nullable Date d) { - this.closeDate = (d != null ? DateUtils.truncate(d, Calendar.SECOND) : null); + this.closeDate = d; return this; } |