mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-09-28 10:09:10 +00:00
Refine the StringUtils#uriDecode method in the following ways: - Use a StringBuilder instead of ByteArrayOutputStream, and only decode %-encoded sequences. - Use HexFormat.fromHexDigits to decode hex sequences. - Decode to a byte array that is only allocated if encoded sequences are encountered. This commit adds another optimization mainly for the use case where there is no encoded sequence, and updates the Javadoc of both StringUtils#uriDecode and UriUtils#decode to match the implementation. Signed-off-by: Patrick Strawderman <pstrawderman@netflix.com> Co-Authored-by: Sebastien Deleuze <sebastien.deleuze@broadcom.com> Closes gh-35253