From 3984266295e138cc5ee68d4a6f46c3f277fd5fa0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B5=B7=E5=AD=90=20Yang?= Date: Fri, 11 Oct 2024 20:57:38 +0800 Subject: [PATCH] Remove unused method in UriComponentsBuilder This commit removes HierarchicalUriComponents#checkSchemeAndHost unused private method. Closes gh-33684 --- .../springframework/web/util/UriComponentsBuilder.java | 9 --------- 1 file changed, 9 deletions(-) diff --git a/spring-web/src/main/java/org/springframework/web/util/UriComponentsBuilder.java b/spring-web/src/main/java/org/springframework/web/util/UriComponentsBuilder.java index 028d0e8695f..f436bc2e96e 100644 --- a/spring-web/src/main/java/org/springframework/web/util/UriComponentsBuilder.java +++ b/spring-web/src/main/java/org/springframework/web/util/UriComponentsBuilder.java @@ -243,15 +243,6 @@ public class UriComponentsBuilder implements UriBuilder, Cloneable { return fromUriString(httpUrl); } - private static void checkSchemeAndHost(String uri, @Nullable String scheme, @Nullable String host) { - if (StringUtils.hasLength(scheme) && scheme.startsWith("http") && !StringUtils.hasLength(host)) { - throw new IllegalArgumentException("[" + uri + "] is not a valid HTTP URL"); - } - if (StringUtils.hasLength(host) && host.startsWith("[") && !host.endsWith("]")) { - throw new IllegalArgumentException("Invalid IPV6 host in [" + uri + "]"); - } - } - /** * Create a new {@code UriComponents} object from the URI associated with * the given HttpRequest while also overlaying with values from the headers