开发者

Reflection and Private Native Methods

开发者 https://www.devze.com 2023-03-11 11:41 出处:网络
I am using reflection to dynamically call some methods from extended class. Unfortunately one of the开发者_运维技巧se methods is declared as private native and as soon as I make the call... I receive

I am using reflection to dynamically call some methods from extended class. Unfortunately one of the开发者_运维技巧se methods is declared as private native and as soon as I make the call... I receive the following exception:

java.lang.IllegalAccessException: Class com.something.somewhere.MyThing ca
n not access a member of class com.something.somewhere.AnotherThing with modifier
s "private native"

Is there a way around this?


are you calling setAccessible(true) on the Method before invoking it?

0

精彩评论

暂无评论...
验证码 换一张
取 消