import java.io.*;
import java.util.ArrayList;
+import java.util.Date;
import java.util.List;
public class AnalysisReportService implements ServerComponent {
defaultIssue.setLine(issue.line());
defaultIssue.setEffortToFix(issue.effortToFix());
setDebt(defaultIssue, issue.debt());
+ setFieldDiffs(defaultIssue, issue.diffFields(), context.getAnalysisDate());
defaultIssue.setStatus(issue.status());
defaultIssue.setResolution(issue.resolution());
defaultIssue.setReporter(issue.reporter());
defaultIssue.setCreationDate(issue.creationDate());
defaultIssue.setUpdateDate(issue.updateDate());
defaultIssue.setCloseDate(issue.closeDate());
- defaultIssue.setCurrentChange(FieldDiffs.parse(issue.diffFields()));
defaultIssue.setChanged(issue.isChanged());
defaultIssue.setNew(issue.isNew());
defaultIssue.setSelectedAt(issue.selectedAt());
return defaultIssue;
}
+ private DefaultIssue setFieldDiffs(DefaultIssue issue, String diffFields, Date analysisDate) {
+ FieldDiffs fieldDiffs = FieldDiffs.parse(diffFields);
+ fieldDiffs.setCreationDate(analysisDate);
+ issue.setCurrentChange(fieldDiffs);
+
+ return issue;
+ }
+
private DefaultIssue setComponentId(DefaultIssue issue, ReportComponent component) {
if (component != null) {
issue.setComponentId((long) component.id());
import javax.annotation.Nullable;
import java.io.File;
+import java.util.Date;
import java.util.HashMap;
import java.util.Map;
private final ComponentDto project;
private File reportDirectory;
private Map<Long, ReportComponent> components = new HashMap<>();
+ private Date analysisDate;
public ComputeEngineContext(AnalysisReportDto reportDto, ComponentDto project) {
this.reportDto = reportDto;
}
public void addResources(ReportComponents reportComponents) {
+ analysisDate = reportComponents.analysisDate();
addResource(reportComponents.root());
}
addResource(childResource);
}
}
+
+ @CheckForNull
+ public Date getAnalysisDate() {
+ return analysisDate;
+ }
}