From 02ae6ed098db3b4b97cebcf02e727596a467bed4 Mon Sep 17 00:00:00 2001 From: Julien Lancelot Date: Mon, 8 Dec 2014 17:38:24 +0100 Subject: [PATCH] Fix quality flaws --- .../server/search/request/ProxyClusterStatsRequestBuilder.java | 1 - .../server/search/request/ProxySearchScrollRequestBuilder.java | 2 +- .../src/main/java/org/sonar/server/source/ws/ShowAction.java | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/server/sonar-server/src/main/java/org/sonar/server/search/request/ProxyClusterStatsRequestBuilder.java b/server/sonar-server/src/main/java/org/sonar/server/search/request/ProxyClusterStatsRequestBuilder.java index cba4108d9f0..3a2ba514026 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/search/request/ProxyClusterStatsRequestBuilder.java +++ b/server/sonar-server/src/main/java/org/sonar/server/search/request/ProxyClusterStatsRequestBuilder.java @@ -28,7 +28,6 @@ import org.elasticsearch.client.Client; import org.elasticsearch.common.unit.TimeValue; import org.sonar.core.profiling.Profiling; import org.sonar.core.profiling.StopWatch; -import org.sonar.server.search.SearchClient; public class ProxyClusterStatsRequestBuilder extends ClusterStatsRequestBuilder { diff --git a/server/sonar-server/src/main/java/org/sonar/server/search/request/ProxySearchScrollRequestBuilder.java b/server/sonar-server/src/main/java/org/sonar/server/search/request/ProxySearchScrollRequestBuilder.java index a54edfb126a..8c5706d78b5 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/search/request/ProxySearchScrollRequestBuilder.java +++ b/server/sonar-server/src/main/java/org/sonar/server/search/request/ProxySearchScrollRequestBuilder.java @@ -45,7 +45,7 @@ public class ProxySearchScrollRequestBuilder extends SearchScrollRequestBuilder } catch (Exception e) { throw new IllegalStateException(String.format("Fail to execute %s", toString()), e); } finally { - if (profiling.isProfilingEnabled(Profiling.Level.BASIC)) { + if (profiling.isProfilingEnabled(Profiling.Level.BASIC)) { fullProfile.stop("%s", toString()); } } diff --git a/server/sonar-server/src/main/java/org/sonar/server/source/ws/ShowAction.java b/server/sonar-server/src/main/java/org/sonar/server/source/ws/ShowAction.java index 79931573e41..9fb60b42a2e 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/source/ws/ShowAction.java +++ b/server/sonar-server/src/main/java/org/sonar/server/source/ws/ShowAction.java @@ -107,7 +107,7 @@ public class ShowAction implements RequestHandler { for (int i = 0; i < lines.size(); i++) { String line = lines.get(i); json.beginArray(); - json.value(i + from); + json.value(1L * i + from); json.value(line); json.endArray(); } -- 2.39.5