Skip to content

JavaKit: add CustomJavaClassLoaderConstructible protocol #159

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 8, 2024

Conversation

lhoward
Copy link
Contributor

@lhoward lhoward commented Nov 7, 2024

Swift projections of Java classes can conform to
CustomJavaClassLoaderConstructible, to provide a custom class loader to be used when constructing new instances.

Fixes: #154

@lhoward
Copy link
Contributor Author

lhoward commented Nov 7, 2024

Bikeshed: CustomJavaClassLoaderConstructible or CustomJavaClassLoaderInitializable?

Copy link
Member

@DougGregor DougGregor left a comment

Choose a reason for hiding this comment

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

This is a great addition, thank you!

@DougGregor
Copy link
Member

Bikeshed: CustomJavaClassLoaderConstructible or CustomJavaClassLoaderInitializable?

I'd prefer to avoid Constructible, since that's not really a thing in Swift. How about just CustomJavaClassLoader, as in, this type has a custom Java class loader?

@lhoward lhoward force-pushed the lhoward/custom-java-class-loader branch from f9291ed to a54c3b5 Compare November 7, 2024 20:21
@lhoward lhoward marked this pull request as ready for review November 7, 2024 20:21
Swift projections of Java classes can conform to CustomJavaClassLoader, to
provide a custom class loader to be used when initializing new instances. This
is useful for platforms such as Android which modify class and class loader
visibility depending on the call stack.

Fixes: swiftlang#154
@lhoward lhoward force-pushed the lhoward/custom-java-class-loader branch from a54c3b5 to cd87fb4 Compare November 7, 2024 20:37
@DougGregor
Copy link
Member

@lhoward anything else you want to do here before we merge?

@lhoward
Copy link
Contributor Author

lhoward commented Nov 7, 2024

@lhoward anything else you want to do here before we merge?

I'm happy for you to merge, unless you want tests (which I am still working on).

@DougGregor
Copy link
Member

I do like tests. Let's wait until you have some tests in place.

@lhoward
Copy link
Contributor Author

lhoward commented Nov 8, 2024

I'm a bit caught up with other stuff today, I'll endeavour to get onto tests next week, feel free to merge (or not) in the interim.

@DougGregor
Copy link
Member

Since this is also needed in the other PR, I'll go ahead and merge.

@DougGregor DougGregor merged commit 286b856 into swiftlang:main Nov 8, 2024
11 checks passed
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.

JavaKit: Class loader hints for Android
2 participants