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: [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]