Properly invoke method
This commit is contained in:
parent
ad40e53349
commit
1a38f25bd9
@ -111,7 +111,7 @@ fun ClassLoader.forceLoadClass(name: String) =
|
|||||||
runCatching { loadClass.invoke(this, name) }.getOrNull() as Class<*>?
|
runCatching { loadClass.invoke(this, name) }.getOrNull() as Class<*>?
|
||||||
|
|
||||||
fun Class<*>.forceGetDeclaredMethod(name: String, vararg types: Class<*>) =
|
fun Class<*>.forceGetDeclaredMethod(name: String, vararg types: Class<*>) =
|
||||||
(runCatching { getDeclaredMethod.invoke(this, name, *types) }.getOrNull() as Method?)?.also {
|
(runCatching { getDeclaredMethod.invoke(this, name, types) }.getOrNull() as Method?)?.also {
|
||||||
it.isAccessible = true
|
it.isAccessible = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user