Skip to content

#1597 - Java 20 deprecates all constructors of the class java.net.URL#1834

Open
rzo1 wants to merge 1 commit intomainfrom
1597
Open

#1597 - Java 20 deprecates all constructors of the class java.net.URL#1834
rzo1 wants to merge 1 commit intomainfrom
1597

Conversation

@rzo1
Copy link
Contributor

@rzo1 rzo1 commented Mar 20, 2026

For all changes

  • Is there a issue associated with this PR? Is it referenced in the commit message?

  • Does your PR title start with #XXXX where XXXX is the issue number you are trying to resolve?

  • Has your PR been rebased against the latest commit within the target branch (typically main)?

  • Is your initial contribution a single, squashed commit?

  • Is the code properly formatted with mvn git-code-format:format-code -Dgcf.globPattern="**/*" -Dskip.format.code=false?

For code changes

  • Have you ensured that the full suite of tests is executed via mvn clean verify?
  • Have you written or updated unit tests to verify your changes?
  • If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under ASF 2.0?
  • If applicable, have you updated the LICENSE file, including the main LICENSE file?
  • If applicable, have you updated the NOTICE file, including the main NOTICE file?

  1. URLUtil.toURL(String) utility method

  - Added URLUtil.toURL(String) that wraps new URI(url).toURL() and converts URISyntaxException into MalformedURLException —
  callers no longer need to handle two exception types
  - Fixed getHostSegments(String) to use toURL() and removed URISyntaxException from its signature

  2. Pre-sanitization in BasicURLNormalizer.sanitizeForURI()

  - Encodes common illegal URI characters before parsing: | → %7C, \ → %5C, space → %20, { → %7B, } → %7D
  - Converts non-standard %uXXXX percent encoding to proper UTF-8 percent encoding (e.g., %u011f → %C4%9F)
  - Applied at the start of filter() so all subsequent URI parsing succeeds
@rzo1 rzo1 added this to the 3.5.2 milestone Mar 20, 2026
@rzo1 rzo1 requested review from jnioche, mvolikas and sigee March 20, 2026 19:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant