From b2b78e6333268b30e8d5825de2ed5d2c5958d7a8 Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Mon, 12 Aug 2013 12:27:03 +0200 Subject: SONAR-4563 Use strict comparison for createdAfter in the Issues search engine --- .../src/main/java/org/sonar/api/issue/IssueQuery.java | 13 +++++++++++++ .../src/main/java/org/sonar/api/issue/RubyIssueService.java | 4 +++- 2 files changed, 16 insertions(+), 1 deletion(-) (limited to 'sonar-plugin-api') diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/issue/IssueQuery.java b/sonar-plugin-api/src/main/java/org/sonar/api/issue/IssueQuery.java index 23e21d30ab6..d7ce899c4f8 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/issue/IssueQuery.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/issue/IssueQuery.java @@ -70,6 +70,7 @@ public class IssueQuery { private final Boolean assigned; private final Boolean planned; private final Boolean resolved; + private final Date createdAtOrAfter; private final Date createdAfter; private final Date createdBefore; private final String sort; @@ -96,6 +97,7 @@ public class IssueQuery { this.assigned = builder.assigned; this.planned = builder.planned; this.resolved = builder.resolved; + this.createdAtOrAfter = builder.createdAtOrAfter; this.createdAfter = builder.createdAfter; this.createdBefore = builder.createdBefore; this.sort = builder.sort; @@ -165,6 +167,11 @@ public class IssueQuery { return (createdAfter == null ? null : new Date(createdAfter.getTime())); } + @CheckForNull + public Date createdAtOrAfter() { + return (createdAtOrAfter == null ? null : new Date(createdAtOrAfter.getTime())); + } + @CheckForNull public Date createdBefore() { return (createdBefore == null ? null : new Date(createdBefore.getTime())); @@ -219,6 +226,7 @@ public class IssueQuery { private Boolean assigned = null; private Boolean planned = null; private Boolean resolved = null; + private Date createdAtOrAfter; private Date createdAfter; private Date createdBefore; private String sort; @@ -307,6 +315,11 @@ public class IssueQuery { return this; } + public Builder createdAtOrAfter(@Nullable Date d) { + this.createdAtOrAfter = (d == null ? null : new Date(d.getTime())); + return this; + } + public Builder createdAfter(@Nullable Date d) { this.createdAfter = (d == null ? null : new Date(d.getTime())); return this; diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/issue/RubyIssueService.java b/sonar-plugin-api/src/main/java/org/sonar/api/issue/RubyIssueService.java index 440105e5787..1afd5e480ee 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/issue/RubyIssueService.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/issue/RubyIssueService.java @@ -63,7 +63,9 @@ public interface RubyIssueService extends ServerComponent { *
  • 'reporters': list of reporter logins. Note that reporters are defined only on "manual" issues.
  • *
  • 'assignees': list of assignee logins.
  • *
  • 'assigned': true to get only assigned issues, false to get only unassigned issues. By default no filtering is done.
  • - *
  • 'createdAfter': match all the issues created after the given date (inclusive). + *
  • 'createdAfter': match all the issues created after the given date (strictly). + * Both date and datetime ISO formats are supported: 2013-05-18 or 2010-05-18T15:50:45+0100
  • + *
  • 'createdAtOrAfter': match all the issues created after the given date (inclusive). * Both date and datetime ISO formats are supported: 2013-05-18 or 2010-05-18T15:50:45+0100
  • *
  • 'createdBefore': match all the issues created before the given date (exclusive). * Both date and datetime ISO formats are supported: 2013-05-18 or 2010-05-18T15:50:45+0100
  • -- cgit v1.2.3