Use URI#create instead of URI constructor where feasible in spring-web

This commit is contained in:
Sam Brannen
2022-12-09 13:26:01 -05:00
parent a1a140f7d5
commit 1b57f2bda5
31 changed files with 163 additions and 178 deletions

View File

@@ -611,7 +611,7 @@ public interface RestOperations {
* <pre class="code">
* MyRequest body = ...
* RequestEntity request = RequestEntity
* .post(new URI(&quot;https://example.com/foo&quot;))
* .post(URI.create(&quot;https://example.com/foo&quot;))
* .accept(MediaType.APPLICATION_JSON)
* .body(body);
* ResponseEntity&lt;MyResponse&gt; response = template.exchange(request, MyResponse.class);
@@ -631,7 +631,7 @@ public interface RestOperations {
* <pre class="code">
* MyRequest body = ...
* RequestEntity request = RequestEntity
* .post(new URI(&quot;https://example.com/foo&quot;))
* .post(URI.create(&quot;https://example.com/foo&quot;))
* .accept(MediaType.APPLICATION_JSON)
* .body(body);
* ParameterizedTypeReference&lt;List&lt;MyResponse&gt;&gt; myBean =