-
1. Re: Private field access in rule action
adinn Apr 30, 2010 11:57 AM (in response to jaikiran)Hi Jaikiran,
jaikiran pai wrote:
Yes, this is what is expected. Byteman rules cannot break normal access rules. Perhaps this needs stating explicitly somewhere in the docs.
It might be possible to introduce special access depending upon the security model in use but this has been avoided up to now -- mainly because it is a lot of work. Do you realy need this? If so raise a JIRA and I will look at what is needed to make it work.
regards,
Andrew Dinn
-
2. Re: Private field access in rule action
jaikiran Apr 30, 2010 12:07 PM (in response to adinn)The usecase I am trying, involves a method which accesses a (private) field and does some operations on it:
public void doSomething() { this.somePrivateFieldWhoseValueIamInterestedIn = // some value; }
The rule I am trying to write is one which wants to know the value of that field. That private field doesn't have any public getter method, so I can't rely on that either.
I guess, this one is a pretty common usecase. So something like this would be handy:
RULE some_rule CLASS blah.Blah METHOD doSomething AT ENTRY IF TRUE DO System.out.println("Value of field is " + $0.somePrivateFieldWhoseValueIamInterestedIn) ENDRULE
If this sounds like a valid feature request, then I'll create a JIRA for this.
-
3. Re: Private field access in rule action
adinn Apr 30, 2010 12:09 PM (in response to jaikiran)Hi Jaikiran,
Yes, please raise a JIRA. Thanks.
Andrew Dinn
-
-
5. Re: Private field access in rule action
adinn Nov 12, 2010 11:13 AM (in response to jaikiran)jaikiran pai wrote:
Hi Jaikiran. Just in case you had not spotted the details in the Byteman 1.4.0 release notes this JIRA has been fixed. It is now possible to access private fields (and prvate methods) in the body of a Byteman rule.
-
6. Re: Private field access in rule action
jaikiran Nov 12, 2010 11:54 AM (in response to adinn)Thanks Andrew for adding this feature! I did notice the release notes and am going to try it out the next time I use Byteman