epugh commented on code in PR #2497:
URL: https://github.com/apache/solr/pull/2497#discussion_r1626768150


##########
solr/core/src/java/org/apache/solr/cli/PostTool.java:
##########
@@ -601,6 +604,7 @@ protected static String normalizeUrlEnding(String link) {
    * @param out output stream to write to
    * @return number of pages crawled on this level and below
    */
+  @SuppressForbidden(reason = "java.net.URL ctors deprecated since Java 20")

Review Comment:
   Do we need this suppress?



##########
solr/core/src/java/org/apache/solr/cli/PostTool.java:
##########
@@ -815,7 +820,7 @@ public void postFile(File file, OutputStream output, String 
type) throws Malform
           urlStr =
               appendParam(urlStr, "literal.id=" + 
URLEncoder.encode(file.getAbsolutePath(), UTF_8));
         }
-        url = new URL(urlStr);
+        url = URI.create(urlStr).toURL();

Review Comment:
   Curious if using a URI would be better than constantly converting back to 
string?   Maybe another pr...



##########
solr/core/src/java/org/apache/solr/cli/PostTool.java:
##########
@@ -624,13 +628,14 @@ protected int webCrawl(int level, OutputStream out) {
         if (result.httpStatus == 200) {
           url = (result.redirectUrl != null) ? result.redirectUrl : url;
           URL postUrl =
-              new URL(
-                  appendParam(
-                      solrUpdateUrl.toString(),
-                      "literal.id="
-                          + URLEncoder.encode(url.toString(), UTF_8)
-                          + "&literal.url="
-                          + URLEncoder.encode(url.toString(), UTF_8)));
+              new URI(

Review Comment:
   If you run tidy do some white space changes go away?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to