Details
-
Type:
New Feature
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 2.0.12
-
Fix Version/s: 2.0.18
-
Component/s: None
-
Labels:None
-
Number of attachments :
Description
I see following code in ReflectiveAccessorOptimizer.
if (m == null) {
/**
- If we didn't find anything, maybe we're looking for the actual java.lang.Class methods.
*/
if ((m = getBestCandidate(argTypes, name, cls, cls.getClass().getDeclaredMethods(), false)) != null) { parameterTypes = m.getParameterTypes(); }}
As I understand, it allows to call any (even protected and private) method of Class.
My problem is that I would like to use MVEL to call protected/private methods of objects.
Right now MVEL checks only public methods:
if ((m = getBestCandidate(argTypes, name, cls, cls.getMethods(), false)) != null)
{ parameterTypes = m.getParameterTypes(); } Is it possible to add some optional flag to configure MVEL to be "safe" for users or turn on "powerful" mode?
For now in each such case I have to fall back to my ReflectionUtils, which is much more verbose and less convenient. ![]()
I.e.
Object menu = ReflectionUtils.invokeMethod(getObject(), "getParent()");
ReflectionUtils.invokeMethod(
menu,
"onDeactivate(com.extjs.gxt.ui.client.widget.menu.MenuBarItem)",
getObject());
instead of short
JavaInfoUtils.executeScript(this, "object.parent.onDeactivate(object)");
Activity
| Field | Original Value | New Value |
|---|---|---|
| Status | Open [ 1 ] | Resolved [ 5 ] |
| Fix Version/s | 2.0.18 [ 16328 ] | |
| Resolution | Fixed [ 1 ] |
| Status | Resolved [ 5 ] | Closed [ 6 ] |
Will look into this when I get back from vacation.