import org.sonar.server.computation.ComputationContext;
import org.sonar.server.computation.issue.IssueComputation;
+import java.util.List;
+
public class ParseReportStep implements ComputationStep {
private final IssueComputation issueComputation;
BatchReportReader reportReader = context.getReportReader();
BatchReport.Component component = reportReader.readComponent(componentRef);
if (component != null) {
- Iterable<BatchReport.Issue> issues = reportReader.readComponentIssues(componentRef);
+ List<BatchReport.Issue> issues = reportReader.readComponentIssues(componentRef);
issueComputation.processComponentIssues(context, component.getUuid(), issues);
for (Integer childRef : component.getChildRefsList()) {
recursivelyProcessComponent(context, childRef);
return this;
}
+ public Date getTechnicalUpdateDate() {
+ return getFieldAsDate(IssueIndexDefinition.FIELD_ISSUE_TECHNICAL_UPDATED_AT);
+ }
+
public IssueDoc setTechnicalUpdateDate(@Nullable Date d) {
setField(IssueIndexDefinition.FIELD_ISSUE_TECHNICAL_UPDATED_AT, d);
return this;
bulk.add(newUpsertRequest(issue));
// it's more efficient to sort programmatically than in SQL on some databases (MySQL for instance)
- maxDate = Math.max(maxDate, issue.updateDate().getTime());
+ maxDate = Math.max(maxDate, issue.getTechnicalUpdateDate().getTime());
}
bulk.stop();
return maxDate;
assertThat(doc.severity()).isEqualTo("BLOCKER");
assertThat(doc.ruleKey()).isEqualTo(RuleKey.of("squid", "AvoidCycles"));
+ // functional date
+ assertThat(doc.updateDate().getTime()).isEqualTo(1368828000000L);
+
+ // technical date
+ assertThat(doc.getTechnicalUpdateDate().getTime()).isEqualTo(1550000000000L);
+
// delete project
indexer.deleteProject("THE_PROJECT", true);
reporter="[null]"
issue_attributes="JIRA=http://jira.com"
action_plan_key="[null]"
- created_at="1000000000"
- updated_at="2000000000"
+ created_at="1500000000000"
+ updated_at="1550000000000"
issue_creation_date="1115848800000"
issue_update_date="1368828000000"
issue_close_date="[null]"
import java.io.File;
import java.util.Collections;
+import java.util.List;
public class BatchReportReader {
return null;
}
- public Iterable<BatchReport.Issue> readComponentIssues(int componentRef) {
+ public List<BatchReport.Issue> readComponentIssues(int componentRef) {
File file = fileStructure.fileFor(FileStructure.Domain.ISSUES, componentRef);
if (file.exists() && file.isFile()) {
// all the issues are loaded in memory