Skip to content

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