aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSébastien Lesaint <sebastien.lesaint@sonarsource.com>2017-01-30 14:39:41 +0100
committerSébastien Lesaint <sebastien.lesaint@sonarsource.com>2017-01-31 14:39:53 +0100
commit9a7b438110508b68b12174426645e382c9732c81 (patch)
treeedc8ec34f89afa217413d7f3b3eb7c0d4d22fef6
parentbe45c77d7b596d2afaf7d5981d13007a100faf24 (diff)
downloadsonarqube-9a7b438110508b68b12174426645e382c9732c81.tar.gz
sonarqube-9a7b438110508b68b12174426645e382c9732c81.zip
fix quality flaw: remove unused field and method
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/ws/WebServiceEngine.java5
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/ws/WebServiceEngineTest.java6
-rw-r--r--sonar-db/src/main/java/org/sonar/db/component/ComponentDao.java8
3 files changed, 2 insertions, 17 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/ws/WebServiceEngine.java b/server/sonar-server/src/main/java/org/sonar/server/ws/WebServiceEngine.java
index 6c0e8ca4b03..4b74897ad9a 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/ws/WebServiceEngine.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/ws/WebServiceEngine.java
@@ -40,7 +40,6 @@ import org.sonar.server.exceptions.BadRequestException;
import org.sonar.server.exceptions.Errors;
import org.sonar.server.exceptions.Message;
import org.sonar.server.exceptions.ServerException;
-import org.sonar.server.user.UserSession;
import org.sonarqube.ws.MediaTypes;
import static com.google.common.base.Preconditions.checkArgument;
@@ -62,10 +61,8 @@ public class WebServiceEngine implements LocalConnector, Startable {
private final WebService.Context context;
private final I18n i18n;
- private final UserSession userSession;
- public WebServiceEngine(WebService[] webServices, I18n i18n, UserSession userSession) {
- this.userSession = userSession;
+ public WebServiceEngine(WebService[] webServices, I18n i18n) {
context = new WebService.Context();
for (WebService webService : webServices) {
webService.define(context);
diff --git a/server/sonar-server/src/test/java/org/sonar/server/ws/WebServiceEngineTest.java b/server/sonar-server/src/test/java/org/sonar/server/ws/WebServiceEngineTest.java
index e0b863b396e..3f0336fd46d 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/ws/WebServiceEngineTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/ws/WebServiceEngineTest.java
@@ -39,7 +39,6 @@ import org.sonar.api.utils.log.LoggerLevel;
import org.sonar.server.exceptions.BadRequestException;
import org.sonar.server.exceptions.Errors;
import org.sonar.server.exceptions.Message;
-import org.sonar.server.tester.UserSessionRule;
import org.sonarqube.ws.MediaTypes;
import static org.assertj.core.api.Assertions.assertThat;
@@ -51,11 +50,8 @@ public class WebServiceEngineTest {
@Rule
public LogTester logTester = new LogTester();
- @Rule
- public UserSessionRule userSessionRule = UserSessionRule.standalone();
-
private I18n i18n = mock(I18n.class);
- private WebServiceEngine underTest = new WebServiceEngine(new WebService[] {new SystemWs()}, i18n, userSessionRule);
+ private WebServiceEngine underTest = new WebServiceEngine(new WebService[] {new SystemWs()}, i18n);
@Before
public void start() {
diff --git a/sonar-db/src/main/java/org/sonar/db/component/ComponentDao.java b/sonar-db/src/main/java/org/sonar/db/component/ComponentDao.java
index 7deb692a59a..dda0e063456 100644
--- a/sonar-db/src/main/java/org/sonar/db/component/ComponentDao.java
+++ b/sonar-db/src/main/java/org/sonar/db/component/ComponentDao.java
@@ -27,7 +27,6 @@ import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Locale;
-import java.util.Map;
import java.util.Set;
import javax.annotation.CheckForNull;
import javax.annotation.Nullable;
@@ -305,13 +304,6 @@ public class ComponentDao implements Dao {
return mapper(dbSession).selectProjectsByNameQuery(nameQueryForSql, includeModules);
}
- private static void addPartialQueryParameterIfNotNull(Map<String, Object> parameters, @Nullable String keyOrNameFilter) {
- // TODO rely on resource_index table and match exactly the key
- if (keyOrNameFilter != null) {
- parameters.put("query", queryParameterFrom(keyOrNameFilter));
- }
- }
-
@CheckForNull
private static String queryParameterFrom(@Nullable String keyOrNameFilter) {
if (keyOrNameFilter != null) {