Affects: 5.3.18


HierarchicalUriComponents::toUri() throws java.lang.NumberFormatException instead of the expected IllegalStateException when provided with a URI of the format https://x.com:string.

Comment From: sbrannen

The underlying issue is that HierarchicalUriComponents.getPort() invokes Integer.parseInt() which throws the NumberFormatException.

Thus, invocations of getPort(), toUri(), toUriString(), and toString() are all affected.

Comment From: sbrannen

Related Issues:

  • 26905

  • 27039

Comment From: sbrannen

This has been addressed in 5.3.x and main.

@Jackson-S, thanks for submitting your first issue for the Spring Framework! 👍