fix(core/wrapper): param map field

In versions higher than 13.22.0.61, the paramMap field is no longer typed as a ConcurrentHashMap

Signed-off-by: rhunk <101876869+rhunk@users.noreply.github.com>
This commit is contained in:
rhunk 2025-01-08 22:52:02 +01:00
parent ebc5469fd0
commit c7cb25c190

View File

@ -10,7 +10,7 @@ import java.util.concurrent.ConcurrentHashMap
class ParamMap(obj: Any?) : AbstractWrapper(obj) {
private val paramMapField: Field by lazy {
instanceNonNull()::class.java.findFields(once = true) {
it.type == ConcurrentHashMap::class.java
it.type == ConcurrentHashMap::class.java || runCatching { it.get(instance) }.getOrNull() is ConcurrentHashMap<*, *>
}.firstOrNull() ?: throw RuntimeException("Could not find paramMap field")
}