Hi,

I encountered a problem in trying to replace classname in a class.
Original code looks like:

  |     public void test()
  |     {
  |         String str = new String("123");
  |         System.out.println(str);
  |     }
  | 
When I apply replaceClassName("java.lang.String", "MyString") on the containing 
class, I got:

  |     public void test()
  |     {
  |         String str = new MyString("123");
  |         System.out.println(str);
  |     }
  | 
But I want it to be:

  |     public void test()
  |     {
  |         MyString str = new MyString("123");
  |         System.out.println(str);
  |     }
  | 
How could I do this with javassist? Thanks!

best,


View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3869550#3869550

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3869550


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to