#301 IllegalAccessException with protected methods in reflection

open
nobody
General (151)
5
2007-09-26
2007-09-26
No

I traced the exception to
bsh.Reflect:82 with the line contents:
"return invokeMethod( method, object, args );"

As I'm running a SVN trunk I just added a method.setAccessible(true) and the problem is fixed for me.

Of-course it depends on developers in charge if this should be added to invokeMethod itself or callers should obey a contract of invoking only accessible methods and thus seting the accessibility before calling.

Discussion


Log in to post a comment.