[JBoss-user] [Javassist user questions] - Re: How to replace this??

2005-02-27 Thread javasvada
Yes, there are many different ways to write code to do the same thing, and smartbytecode is not supposed to find all in one pass. Multiple passes is needed, and if planned carefully most cases can be found... Works fine for me at least.. :) chiba wrote : I see. Your approach is right.

[JBoss-user] [Javassist user questions] - Re: Constructor modification?

2005-02-25 Thread javasvada
chiba wrote : Ah... the statements must be surrounded by {}. | So | | setBody({ System.out.println(...); ...println(...); }); | | is correct. I agree this spec. should be changed. :-( Ah, I see, it works now. Thanks for the reply :) View the original post :

[JBoss-user] [Javassist user questions] - Re: How to replace this??

2005-02-23 Thread javasvada
chiba wrote : I think you want to replace cascaded method calls | with another expression. | | But I'm wondering whether or not such replacement | is used frequently enough to be included in the Javassist | API. Do you think the Javassist API includes a method | for replacing

[JBoss-user] [Javassist user questions] - How to replace this??

2005-02-21 Thread javasvada
I need to find and replace all instances of if(Display.getDisplay(this).getCurrent()==null) | { | ... | } in a given class, with if (_getCurrent()==null) | { | ... | } _getCurrent() is a local method in the same class. Sounds easy, but I have found no way to do this in Javassist so

[JBoss-user] [Javassist user questions] - Constructor modification?

2005-02-19 Thread javasvada
I am modifying an existing constructor | CtConstructor constructor=cc.getConstructors()[0]; | constructor.setBody(System.out.println(\hello1\); System.out.println(\hello2\); ); | But for some reason, only the first statement is added (I double checked by decompiling the class), and