]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-8740 remove arguable use of Stream API
authorSébastien Lesaint <sebastien.lesaint@sonarsource.com>
Fri, 3 Feb 2017 09:22:01 +0000 (10:22 +0100)
committerSébastien Lesaint <sebastien.lesaint@sonarsource.com>
Tue, 7 Feb 2017 09:27:25 +0000 (10:27 +0100)
server/sonar-server/src/main/java/org/sonar/server/favorite/ws/SearchAction.java

index d697c55f3bbdcb7654b1e88269e1fc776341b79d..0a08b4e60f97bb15cd0039c0b93675aebac917d6 100644 (file)
@@ -24,7 +24,6 @@ import com.google.common.collect.ImmutableSet;
 import java.util.List;
 import java.util.Set;
 import java.util.function.Predicate;
-import java.util.stream.Stream;
 import org.sonar.api.server.ws.Request;
 import org.sonar.api.server.ws.Response;
 import org.sonar.api.server.ws.WebService;
@@ -72,11 +71,9 @@ public class SearchAction implements FavoritesWsAction {
 
   @Override
   public void handle(Request request, Response response) throws Exception {
-    SearchResponse wsResponse = Stream.of(request)
-      .map(SearchAction::toWsRequest)
-      .map(this::toSearchResults)
-      .map(this::toSearchResponse)
-      .collect(Collectors.toOneElement());
+    SearchRequest searchRequest = toWsRequest(request);
+    SearchResults searchResults = toSearchResults(searchRequest);
+    SearchResponse wsResponse = toSearchResponse(searchResults);
     writeProtobuf(wsResponse, request, response);
   }