[
https://issues.jboss.org/browse/JASSIST-197?page=com.atlassian.jira.plugi...
]
Ross Allan edited comment on JASSIST-197 at 5/22/13 3:20 PM:
-------------------------------------------------------------
{code:title=Example.java|borderStyle=solid}
public void example(SomeInterface a, ...) {
// Some code.
<something>.postEvent(someEventObject);
// Some code.
}
{code}
I am then replacing the method call to postEvent, and need to access both the parameter
someEventObject of postEvent, and the SomeInterface parameter "a" of the example
method.
This is a simplified example, and the patch must be applied to multiple versions of the
'example' method, so simply replacing the entire method content is not an option.
I tried to implement it myself, but many of the methods/fields used via MethodCall.replace
aren't public, so it quickly turned into a mess of reflection just to make a
(probably) small change.
was (Author: nallar):
public void example(SomeInterface a, ...) {
// Some code.
<something>.postEvent(someEventObject);
// Some code.
}
I am then replacing the method call to postEvent, and need to access both the parameter
someEventObject of postEvent, and the SomeInterface parameter "a" of the example
method.
This is a simplified example, and the patch must be applied to multiple versions of the
'example' method, so simply replacing the entire method content is not an option.
I tried to implement it myself, but many of the methods/fields used via MethodCall.replace
aren't public, so it quickly turned into a mess of reflection just to make a
(probably) small change.
Method parameters can not be accessed when using MethodCall.replace
-------------------------------------------------------------------
Key: JASSIST-197
URL:
https://issues.jboss.org/browse/JASSIST-197
Project: Javassist
Issue Type: Feature Request
Affects Versions: 3.17.1-GA
Reporter: Ross Allan
Assignee: Shigeru Chiba
When instrumenting and using MethodCall.replace there does not seem to be any way to
access the parameters of the method which the method call is in, it is only possible to
access the parameters of the method call.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:
http://www.atlassian.com/software/jira