diff options
author | Simon Brandhof <simon.brandhof@gmail.com> | 2013-05-28 15:59:55 +0200 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@gmail.com> | 2013-05-28 16:00:13 +0200 |
commit | 23020e44e40f274e200b68351e6ba203f3821410 (patch) | |
tree | d249e71f2910e2f9897ab50efe76872019e67589 | |
parent | 84f8dcc043c572db2b8a967a2d54998302421867 (diff) | |
download | sonarqube-23020e44e40f274e200b68351e6ba203f3821410.tar.gz sonarqube-23020e44e40f274e200b68351e6ba203f3821410.zip |
SONAR-3755 fix issue close date
-rw-r--r-- | sonar-batch/src/main/java/org/sonar/batch/issue/ScanIssues.java | 1 | ||||
-rw-r--r-- | sonar-core/src/main/java/org/sonar/core/issue/DefaultIssueBuilder.java | 14 |
2 files changed, 2 insertions, 13 deletions
diff --git a/sonar-batch/src/main/java/org/sonar/batch/issue/ScanIssues.java b/sonar-batch/src/main/java/org/sonar/batch/issue/ScanIssues.java index 4d0e5863023..fa59a1d64c4 100644 --- a/sonar-batch/src/main/java/org/sonar/batch/issue/ScanIssues.java +++ b/sonar-batch/src/main/java/org/sonar/batch/issue/ScanIssues.java @@ -77,7 +77,6 @@ public class ScanIssues implements BatchComponent { } issue.setCreationDate(project.getAnalysisDate()); issue.setUpdateDate(project.getAnalysisDate()); - issue.setCloseDate(project.getAnalysisDate()); if (issue.severity() == null) { issue.setSeverity(activeRule.getSeverity().name()); } diff --git a/sonar-core/src/main/java/org/sonar/core/issue/DefaultIssueBuilder.java b/sonar-core/src/main/java/org/sonar/core/issue/DefaultIssueBuilder.java index e3ec577a3ca..eea97b60d0b 100644 --- a/sonar-core/src/main/java/org/sonar/core/issue/DefaultIssueBuilder.java +++ b/sonar-core/src/main/java/org/sonar/core/issue/DefaultIssueBuilder.java @@ -43,7 +43,6 @@ public class DefaultIssueBuilder implements Issuable.IssueBuilder { private String message; private String severity; private Double effortToFix; - private Date createdDate; private String reporter; private Map<String, String> attributes; @@ -61,11 +60,6 @@ public class DefaultIssueBuilder implements Issuable.IssueBuilder { return this; } - public DefaultIssueBuilder createdDate(@Nullable Date date) { - this.createdDate = date; - return this; - } - @Override public Issuable.IssueBuilder ruleKey(RuleKey ruleKey) { this.ruleKey = ruleKey; @@ -122,23 +116,19 @@ public class DefaultIssueBuilder implements Issuable.IssueBuilder { String key = UUID.randomUUID().toString(); Preconditions.checkState(!Strings.isNullOrEmpty(key), "Fail to generate issue key"); issue.setKey(key); - - Date now = new Date(); - Date date = Objects.firstNonNull(createdDate, now); - issue.setCreationDate(date); - issue.setUpdateDate(date); issue.setComponentKey(componentKey); issue.setProjectKey(projectKey); issue.setRuleKey(ruleKey); issue.setMessage(message); issue.setSeverity(Objects.firstNonNull(severity, Severity.MAJOR)); + issue.setManualSeverity(false); issue.setEffortToFix(effortToFix); issue.setLine(line); - issue.setManualSeverity(false); issue.setReporter(reporter); issue.setAttributes(attributes); issue.setResolution(null); issue.setStatus(Issue.STATUS_OPEN); + issue.setCloseDate(null); issue.setNew(true); issue.setEndOfLife(false); issue.setOnDisabledRule(false); |