From d41a260a0b4ca8d18e2078b2ac08d8c5e4203f4e Mon Sep 17 00:00:00 2001 From: Stephane Gamard Date: Thu, 4 Sep 2014 16:06:07 +0200 Subject: [PATCH] SONAR-5531 - Removed not needed IssueMapping (Using legacy writer for API Compatibility) --- .../server/issue/index/IssueMapping.java | 30 ------------------- .../sonar/server/issue/ws/SearchAction.java | 10 ++----- 2 files changed, 2 insertions(+), 38 deletions(-) delete mode 100644 server/sonar-server/src/main/java/org/sonar/server/issue/index/IssueMapping.java diff --git a/server/sonar-server/src/main/java/org/sonar/server/issue/index/IssueMapping.java b/server/sonar-server/src/main/java/org/sonar/server/issue/index/IssueMapping.java deleted file mode 100644 index ce40c4daca3..00000000000 --- a/server/sonar-server/src/main/java/org/sonar/server/issue/index/IssueMapping.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube, open source software quality management tool. - * Copyright (C) 2008-2014 SonarSource - * mailto:contact AT sonarsource DOT com - * - * SonarQube is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * SonarQube is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -package org.sonar.server.issue.index; - -import org.sonar.server.search.ws.BaseMapping; - -public class IssueMapping extends BaseMapping { - -} - -class IssueMappingContext { - -} 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 cd7f0f7c972..588bcee2607 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 @@ -22,7 +22,6 @@ package org.sonar.server.issue.ws; import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Function; import com.google.common.base.Strings; -import com.google.common.collect.ImmutableList; import com.google.common.collect.Iterables; import com.google.common.io.Resources; import org.sonar.api.component.Component; @@ -50,7 +49,6 @@ import org.sonar.core.component.ComponentDto; import org.sonar.markdown.Markdown; import org.sonar.server.issue.IssueService; import org.sonar.server.issue.filter.IssueFilterParameters; -import org.sonar.server.issue.index.IssueMapping; import org.sonar.server.issue.index.IssueResult; import org.sonar.server.search.QueryOptions; import org.sonar.server.search.ws.SearchOptions; @@ -80,14 +78,12 @@ public class SearchAction implements RequestHandler { public static final String PARAM_FACETS = "facets"; private final IssueService service; - private final IssueMapping mapping; private final IssueActionsWriter actionsWriter; private final I18n i18n; private final Durations durations; - public SearchAction(IssueService service, IssueMapping mapping, IssueActionsWriter actionsWriter, I18n i18n, Durations durations) { + public SearchAction(IssueService service, IssueActionsWriter actionsWriter, I18n i18n, Durations durations) { this.service = service; - this.mapping = mapping; this.actionsWriter = actionsWriter; this.i18n = i18n; this.durations = durations; @@ -103,8 +99,6 @@ public class SearchAction implements RequestHandler { // Add globalized search options. Will also support legacy params // Generic search parameters - SearchOptions.defineFieldsParam(action, - ImmutableList.builder().addAll(mapping.supportedFields()).build()); SearchOptions.definePageParams(action); // Issue-specific search parameters @@ -206,7 +200,7 @@ public class SearchAction implements RequestHandler { IssueQuery query = createQuery(request); SearchOptions searchOptions = SearchOptions.create(request); QueryOptions queryOptions = new QueryOptions(); - mapping.newQueryOptions(searchOptions); + queryOptions.setPage(searchOptions.page(), searchOptions.pageSize()); queryOptions.setFacet(request.mandatoryParamAsBoolean(PARAM_FACETS)); IssueResult results = service.search(query, queryOptions); -- 2.39.5