Skip to content

Avoid direct URL construction and URL equality checks #29486

@jhoeller

Description

@jhoeller

As a first step towards #29481, driven by the deprecation of the java.net.URL constructors in JDK 20, we can factor out all URL construction to toURL methods in ResourceUtils, centralizing the use of java.net.URL constructors and therefore also their possible replacement in the future.

Also, UrlResource traditionally uses equality on a cleaned URL instance for comparisons. This can be replaced with a check on a cleaned URL String, sourced from either a URI or a URL instance.

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions