import org.sonar.api.issue.impact.SoftwareQuality;
import org.sonar.core.issue.status.IssueStatus;
-import static com.google.common.base.Preconditions.checkArgument;
-
public final class IndexedIssueDto {
private String issueKey = null;
private String assignee = null;
Map<MetricDto, LiveMeasureDto> measuresByMetric = getMeasuresByMetric(measures, metrics);
Measures.Period period = snapshotToWsPeriods(analysis).orElse(null);
- RefComponent reference = getReference(dbSession, component).orElse(null);
- return buildResponse(dbSession, request, component, reference, measuresByMetric, metrics, period, request.getMetricKeys());
+ return buildResponse(dbSession, request, component, measuresByMetric, metrics, period, request.getMetricKeys());
}
}
return refBranch.map(rb -> new RefComponent(rb, refComponent.get()));
}
- private ComponentWsResponse buildResponse(DbSession dbSession, ComponentRequest request, ComponentDto component, @Nullable RefComponent reference,
+ private ComponentWsResponse buildResponse(DbSession dbSession, ComponentRequest request, ComponentDto component,
Map<MetricDto, LiveMeasureDto> measuresByMetric, Collection<MetricDto> metrics, @Nullable Measures.Period period,
Collection<String> requestedMetrics) {
+
ComponentWsResponse.Builder response = ComponentWsResponse.newBuilder();
+ RefComponent reference = getReference(dbSession, component).orElse(null);
if (reference != null) {
BranchDto refBranch = reference.getRefBranch();
ComponentDto refComponent = reference.getComponent();