aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>2015-03-30 10:35:10 +0200
committerJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>2015-03-30 10:35:10 +0200
commitcf5621c60850a342757bf146612fda9c34ce3756 (patch)
treef00fcc6c05a4601c3db21547c5be15b5abb1f8c8
parentf17e51ced99a7f97f746305e3a90529a98eab04a (diff)
downloadsonarqube-cf5621c60850a342757bf146612fda9c34ce3756.tar.gz
sonarqube-cf5621c60850a342757bf146612fda9c34ce3756.zip
Fix regression on issue paging with one component
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/issue/ws/SearchAction.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/issue/ws/SearchAction.java b/server/sonar-server/src/main/java/org/sonar/server/issue/ws/SearchAction.java
index 9898640cb76..b11bda5e624 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/issue/ws/SearchAction.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/issue/ws/SearchAction.java
@@ -270,6 +270,9 @@ public class SearchAction implements BaseIssuesWsAction {
public final void handle(Request request, Response response) throws Exception {
SearchOptions options = new SearchOptions();
options.setPage(request.mandatoryParamAsInt(WebService.Param.PAGE), request.mandatoryParamAsInt(WebService.Param.PAGE_SIZE));
+ if (shouldIgnorePaging(request)) {
+ options.disableLimit();
+ }
options.addFacets(request.paramAsStrings(WebService.Param.FACETS));
IssueQuery query = issueQueryService.createFromRequest(request);
@@ -286,6 +289,13 @@ public class SearchAction implements BaseIssuesWsAction {
json.endObject().close();
}
+ private boolean shouldIgnorePaging(Request request) {
+ List<String> componentUuids = request.paramAsStrings(IssueFilterParameters.COMPONENT_UUIDS);
+ // Paging can be ignored only when querying issues for a single component (e.g in component viewer)
+ return componentUuids != null && componentUuids.size() == 1
+ && BooleanUtils.isTrue(request.paramAsBoolean(IssueFilterParameters.IGNORE_PAGING));
+ }
+
private SearchResult<IssueDoc> execute(IssueQuery query, SearchOptions options) {
Collection<String> components = query.componentUuids();
if (components != null && components.size() == 1 && BooleanUtils.isTrue(query.ignorePaging())) {