From b81e1c51689f19e01d9c9272e81ec1b4cc52a062 Mon Sep 17 00:00:00 2001 From: Dejan Milisavljevic Date: Thu, 28 Nov 2024 16:40:25 +0100 Subject: SONAR-23733 Use Software Quality metrics when in MQR mode --- .../main/java/org/sonar/db/measure/ProjectMeasureDto.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/measure/ProjectMeasureDto.java b/server/sonar-db-dao/src/main/java/org/sonar/db/measure/ProjectMeasureDto.java index fe65d2929c3..8361462b03e 100644 --- a/server/sonar-db-dao/src/main/java/org/sonar/db/measure/ProjectMeasureDto.java +++ b/server/sonar-db-dao/src/main/java/org/sonar/db/measure/ProjectMeasureDto.java @@ -23,6 +23,7 @@ import com.google.common.base.MoreObjects; import java.nio.charset.StandardCharsets; import javax.annotation.CheckForNull; import javax.annotation.Nullable; +import org.sonar.core.util.UuidFactoryImpl; public class ProjectMeasureDto { private static final int MAX_TEXT_VALUE_LENGTH = 4000; @@ -129,6 +130,18 @@ public class ProjectMeasureDto { return this; } + public ProjectMeasureDto copy() { + ProjectMeasureDto copy = new ProjectMeasureDto() + .setAlertStatus(alertStatus) + .setAnalysisUuid(analysisUuid) + .setAlertText(alertText) + .setComponentUuid(componentUuid) + .setMetricUuid(metricUuid) + .setData(getData()) + .setValue(value); + copy.setUuid(UuidFactoryImpl.INSTANCE.create()); + return copy; + } @Override public String toString() { return MoreObjects.toStringHelper(this) -- cgit v1.2.3