aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@sonarsource.com>2016-01-04 12:55:20 +0100
committerJulien Lancelot <julien.lancelot@sonarsource.com>2016-01-05 10:22:32 +0100
commitf9fdd6ac956d820fb5186b992e110d01373513b6 (patch)
tree73d96115cad97c2b70ff55394c5b3b9831c0d682 /server
parentb182a2db0aa5e8027e2f411b61636c8a2d5ed5c3 (diff)
downloadsonarqube-f9fdd6ac956d820fb5186b992e110d01373513b6.tar.gz
sonarqube-f9fdd6ac956d820fb5186b992e110d01373513b6.zip
SONAR-7127 Fix ComponentQuery for DevCockpit
Create ComponentQuery with a Builder Restore missing constructor for Dev Cokpit
Diffstat (limited to 'server')
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/component/ws/SearchAction.java9
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/computation/ws/ActivityAction.java2
2 files changed, 6 insertions, 5 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/component/ws/SearchAction.java b/server/sonar-server/src/main/java/org/sonar/server/component/ws/SearchAction.java
index 106817ee760..e9816998202 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/component/ws/SearchAction.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/component/ws/SearchAction.java
@@ -157,10 +157,11 @@ public class SearchAction implements ComponentsWsAction {
}
private ComponentQuery buildQuery(SearchWsRequest request, List<String> qualifiers) {
- return new ComponentQuery(
- request.getQuery(),
- request.getLanguage(),
- qualifiers.toArray(new String[qualifiers.size()]));
+ return ComponentQuery.builder()
+ .setNameOrKeyQuery(request.getQuery())
+ .setLanguage(request.getLanguage())
+ .setQualifiers(qualifiers.toArray(new String[qualifiers.size()]))
+ .build();
}
private void validateQualifiers(List<String> qualifiers) {
diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/ws/ActivityAction.java b/server/sonar-server/src/main/java/org/sonar/server/computation/ws/ActivityAction.java
index 96257566307..012100961b3 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/computation/ws/ActivityAction.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/computation/ws/ActivityAction.java
@@ -160,7 +160,7 @@ public class ActivityAction implements CeWsAction {
query.setComponentUuid(componentUuid);
}
if (componentQuery != null) {
- ComponentQuery componentDtoQuery = new ComponentQuery(componentQuery, null, Qualifiers.PROJECT, Qualifiers.VIEW);
+ ComponentQuery componentDtoQuery = ComponentQuery.builder().setNameOrKeyQuery(componentQuery).setQualifiers(Qualifiers.PROJECT, Qualifiers.VIEW).build();
List<ComponentDto> componentDtos = dbClient.componentDao().selectByQuery(dbSession, componentDtoQuery, 0, CeActivityQuery.MAX_COMPONENT_UUIDS);
query.setComponentUuids(Lists.transform(componentDtos, ComponentDtoFunctions.toUuid()));
}