Skip to content

Resolve manual workarounds for URLClassLoader generation#621

Merged
ktoso merged 2 commits intoswiftlang:mainfrom
sidepelican:urlclassloader
Mar 16, 2026
Merged

Resolve manual workarounds for URLClassLoader generation#621
ktoso merged 2 commits intoswiftlang:mainfrom
sidepelican:urlclassloader

Conversation

@sidepelican
Copy link
Contributor

Resolves: #423

This PR reorganizes the target assignments for several classes to enable the code generation of URLClassLoader using only the wrap-java command.

Unlike Java, which allows bidirectional imports between packages, Swift targets cannot have circular dependencies.
To avoid dependency loops, I’ve had to consolidate these core classes into SwiftJava target.

Relocations:

java class before Swift target after
java.net.URL JavaNet SwiftJava
java.util.Enumeration JavaUtil SwiftJava

@sidepelican sidepelican requested a review from ktoso as a code owner March 16, 2026 02:44
Copy link
Collaborator

@ktoso ktoso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ktoso
Copy link
Collaborator

ktoso commented Mar 16, 2026

Thanks for the ongoing work here!

@ktoso ktoso merged commit c91e140 into swiftlang:main Mar 16, 2026
61 checks passed
@sidepelican sidepelican deleted the urlclassloader branch March 16, 2026 05:43
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.

JavaStdlib/JavaNet.URLClassLoader must inherit ClassLoader

2 participants