Skip to content

Commit

Permalink
fix: java kotlin wrapper loop
Browse files Browse the repository at this point in the history
  • Loading branch information
Suqatri committed Jul 9, 2024
1 parent aa99c88 commit 28de7a5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ class CloudJKWrapper {

companion object {
@JvmStatic
fun injectCloudAPI(clazz: Class<out CloudInjectable>, cloudInjectable: CloudInjectable) {
injectCloudAPI(clazz, cloudInjectable)
fun <T : CloudInjectable> injectCloudAPI(clazz: Class<T>, cloudInjectable: T) {
injectApi(clazz, cloudInjectable)
}

@JvmStatic
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import com.google.inject.Injector
lateinit var injector: Injector

inline fun <reified T : CloudInjectable> T.injectCloudApi() {
injectCloudApi(T::class.java, this)
injectApi(T::class.java, this)
}

fun <T : CloudInjectable> injectCloudApi(clazz: Class<T>, instance: T) {
fun <T : CloudInjectable> injectApi(clazz: Class<T>, instance: T) {
val membersInjector = injector.getMembersInjector(clazz)
membersInjector.injectMembers(instance)
}
Expand Down

0 comments on commit 28de7a5

Please sign in to comment.