aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukasz Jarocki <lukasz.jarocki@sonarsource.com>2022-10-06 10:40:32 +0200
committersonartech <sonartech@sonarsource.com>2022-10-12 20:03:44 +0000
commit1dcc2dc85ebd2641f9c22a6d5d316ee1f1a5e883 (patch)
treeb75d5fcbccdef63f846ad154a0816de755bfcb76
parent50b12df3787d87958fcef7fbf8c00598b141f1ee (diff)
downloadsonarqube-1dcc2dc85ebd2641f9c22a6d5d316ee1f1a5e883.tar.gz
sonarqube-1dcc2dc85ebd2641f9c22a6d5d316ee1f1a5e883.zip
SONAR-17352 Refactor component keys to not include branch suffix
-rw-r--r--server/sonar-db-dao/src/main/java/org/sonar/db/property/PropertiesDao.java9
-rw-r--r--server/sonar-webserver-webapi/src/main/java/org/sonar/server/component/ws/ShowAction.java2
2 files changed, 5 insertions, 6 deletions
diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/property/PropertiesDao.java b/server/sonar-db-dao/src/main/java/org/sonar/db/property/PropertiesDao.java
index ae54ec9fd17..2b4faf0ec44 100644
--- a/server/sonar-db-dao/src/main/java/org/sonar/db/property/PropertiesDao.java
+++ b/server/sonar-db-dao/src/main/java/org/sonar/db/property/PropertiesDao.java
@@ -42,7 +42,6 @@ import org.sonar.db.audit.AuditPersister;
import org.sonar.db.audit.model.PropertyNewValue;
import static com.google.common.base.Preconditions.checkArgument;
-import static java.util.Collections.emptyList;
import static java.util.Collections.singletonList;
import static org.apache.commons.lang.StringUtils.repeat;
import static org.sonar.db.DatabaseUtils.executeLargeInputs;
@@ -152,13 +151,13 @@ public class PropertiesDao implements Dao {
}
}
- public List<PropertyDto> selectComponentProperties(DbSession session, String uuid) {
- return getMapper(session).selectByComponentUuids(singletonList(uuid));
+ public List<PropertyDto> selectComponentProperties(DbSession session, String componentUuid) {
+ return getMapper(session).selectByComponentUuids(singletonList(componentUuid));
}
- public List<PropertyDto> selectComponentProperties(String uuid) {
+ public List<PropertyDto> selectComponentProperties(String componentUuid) {
try (DbSession session = mybatis.openSession(false)) {
- return selectComponentProperties(session, uuid);
+ return selectComponentProperties(session, componentUuid);
}
}
diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/component/ws/ShowAction.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/component/ws/ShowAction.java
index ca42f019916..f7525e9e56d 100644
--- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/component/ws/ShowAction.java
+++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/component/ws/ShowAction.java
@@ -157,7 +157,7 @@ public class ShowAction implements ComponentsWsAction {
String branch = dbClient.branchDao().selectByUuid(dbSession, component.getCopyComponentUuid())
.map(BranchDto::getKey)
.orElse(null);
- componentDtoToWsComponent(component, parentProject.orElse(null), lastAnalysis, branch, null)
+ return componentDtoToWsComponent(component, parentProject.orElse(null), lastAnalysis, branch, null)
.setNeedIssueSync(needIssueSync);
}
return componentDtoToWsComponent(component, parentProject.orElse(null), lastAnalysis, request.branch, request.pullRequest)