Remove the method which was added in jdk 16
The Stream.toList() is a new method and can't be used within google.
Release-Notes: skip
Change-Id: I99cd9c7bf771b5a0097dbd319dd056c50b5abdee
diff --git a/java/com/google/gerrit/httpd/NumericChangeIdRedirectServlet.java b/java/com/google/gerrit/httpd/NumericChangeIdRedirectServlet.java
index 5d15a56..c797c47 100644
--- a/java/com/google/gerrit/httpd/NumericChangeIdRedirectServlet.java
+++ b/java/com/google/gerrit/httpd/NumericChangeIdRedirectServlet.java
@@ -14,6 +14,9 @@
package com.google.gerrit.httpd;
+import static com.google.common.collect.ImmutableList.toImmutableList;
+
+import com.google.common.collect.ImmutableList;
import com.google.gerrit.common.PageLinks;
import com.google.gerrit.entities.Change;
import com.google.gerrit.extensions.restapi.ResourceConflictException;
@@ -25,7 +28,6 @@
import com.google.inject.Singleton;
import java.io.IOException;
import java.util.Arrays;
-import java.util.List;
import java.util.Optional;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
@@ -60,7 +62,8 @@
int commentIdx = uriPath.indexOf("/comment");
String idString = commentIdx == -1 ? uriPath : uriPath.substring(0, commentIdx);
- List<String> uriSegments = Arrays.stream(idString.split("/")).toList();
+ ImmutableList<String> uriSegments =
+ Arrays.stream(idString.split("/")).collect(toImmutableList());
idString = uriSegments.get(0);
String psString = (uriSegments.size() > 1) ? uriSegments.get(1) : null;