uschindler commented on code in PR #2501:
URL: https://github.com/apache/solr/pull/2501#discussion_r1637690443


##########
solr/solrj/src/test/org/apache/solr/common/util/ContentStreamTest.java:
##########
@@ -161,7 +161,7 @@ public void testURLStreamCSVGZIPExtention() throws 
IOException {
     }
 
     ContentStreamBase stream =
-        new ContentStreamBase.URLStream(new URL(file.toURI().toASCIIString()));
+        new 
ContentStreamBase.URLStream(URI.create(file.toURI().toASCIIString()).toURL());

Review Comment:
   this code makes no sense (also at other places above). Just call 
`file.toURI().toURL()`



##########
solr/core/src/test/org/apache/solr/cloud/TestRequestForwarding.java:
##########
@@ -69,6 +71,12 @@ public void testMultiCollectionQuery() throws Exception {
     }
   }
 
+  // Restricting the Scope of Forbidden API
+  @SuppressForbidden(reason = "java.net.URL#<init> deprecated since Java 20")
+  private URL createURL(String url) throws MalformedURLException {

Review Comment:
   why not use `URI.create().toURL()`?



##########
solr/solrj/src/test/org/apache/solr/common/util/ContentStreamTest.java:
##########
@@ -161,7 +161,7 @@ public void testURLStreamCSVGZIPExtention() throws 
IOException {
     }
 
     ContentStreamBase stream =
-        new ContentStreamBase.URLStream(new URL(file.toURI().toASCIIString()));
+        new 
ContentStreamBase.URLStream(URI.create(file.toURI().toASCIIString()).toURL());

Review Comment:
   see other occurrences of this in this and other files



-- 
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: issues-unsubscr...@solr.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org

Reply via email to