Skip to content

Replace the deprecated URL(String) constructor - #2305

Merged
akurtakov merged 1 commit into
eclipse-wildwebdeveloper:masterfrom
akurtakov:replace-deprecated-url-constructor
Nov 26, 2026
Merged

akurtakov merged 1 commit into
eclipse-wildwebdeveloper:masterfrom
akurtakov:replace-deprecated-url-constructor

Conversation

@akurtakov

Copy link
Copy Markdown
Contributor

new URL(String) is deprecated since Java 20. Replace its five uses with URI + URI.toURL():

  • ESLintClientImpl: opening the rule documentation URL
  • SchemaAssociationRegistry: resolving contributed platform: schema URLs, falling back to the original string as before
  • AbstractRunHTMLDebugTab: URL validation, also catching URISyntaxException/IllegalArgumentException so relative input reports an error instead of throwing
  • SchemaAssociationDialog: file: locations are taken as plain paths, as Browse fills them in without encoding (paths with spaces would otherwise be rejected); other locations are validated with new URI(...).toURL()
  • XMLCatalogs: the URI of the JAR is built with the multi-argument URI constructor, which keeps quoting badly encoded paths (Not URI encoding WTP Catalog paths #756) like convertToURI did

TestXML, TestJSON and TestYaml pass locally.

Use URI and URI.toURL() instead, catching IllegalArgumentException where
the URI isn't absolute or invalid.

SchemaAssociationDialog takes file: locations as plain paths, as the
Browse button fills them in without encoding, and XMLCatalogs builds the
URI of the JAR with the multi-argument URI constructor so that badly
encoded paths keep being quoted.

Assisted-by: Anthropic Claude Code (claude-opus-5-5)
@akurtakov
akurtakov merged commit f44e8be into eclipse-wildwebdeveloper:master Nov 26, 2026
9 of 15 checks passed
@akurtakov
akurtakov deleted the replace-deprecated-url-constructor branch November 26, 2026 19:07
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