For example i have the class :
public class Test1 {
| static int res;
|
| public static void main(String[] args) {
| foo (2);
| }
|
| public static int foo(int num) {
| res = num + 2;
| return res;
| }
| }
I want to get the parameter value of foo (here '2') and the returned value
(here '4') and then transform the class by adding it 2 fields with these values
like this :
public class Test1 {
| static int res;
| static int paramValue = 2;
| static int returnValue = 4;
| public static void main(String[] args) {
| foo (2);
| }
|
| public static int foo(int num) {
| res = num + 2;
| return res;
| }
| }
Is there a way to perform this with Javassist ?
Many thanks for any help !
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3881915#3881915
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3881915
-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user