[jboss-user] [Javassist user questions] - Autoboxing

2008-03-22 Thread gkorland
I'm trying to call a method with arguments that might need autoboxing. But I'm getting the following error: Caused by: compile error: f(org.p.test.main.AA,int,int) not found in org.p.MyClass at javassist.compiler.TypeChecker.atMethodCallCore(TypeChecker.java:716) at

[jboss-user] [Javassist user questions] - Re: Duplicate a method

2008-02-21 Thread gkorland
Yes, thanks I found it myself few days ago, do you think there's a way to make it happen anyway? View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4131210#4131210 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4131210

[jboss-user] [Javassist user questions] - Re: adding annotations

2008-02-20 Thread gkorland
To add annotation to a class on load time the cleaner way to do it is to use javaagent. See: http://javahowto.blogspot.com/2006/07/javaagent-option.html Guy View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4130933#4130933 Reply to the post :

[jboss-user] [Javassist user questions] - Re: adding annotations

2008-02-19 Thread gkorland
Hi Luca, Check the AnnotationsAttribute JDoc. ClassFile cf = ... ; ConstPool cp = cf.getConstPool(); AnnotationsAttribute attr = new AnnotationsAttribute(cp, AnnotationsAttribute.visibleTag); Annotation a = new Annotation(Author, cp); a.addMemberValue(name, new StringMemberValue(Chiba, cp));

[jboss-user] [Javassist user questions] - problem initialize a local variable

2008-02-15 Thread gkorland
Hi, I'm trying to add a local variable and then initialize it. The code is pretty simple (define a local variable and use a static get() to assign a value): method.addLocalVariable(LOCAL_VARIBALE_NAME, TEST_CLASS); method.insertBefore(LOCAL_VARIBALE_NAME + = + TEST_CLASS.getName() + .get(););

[jboss-user] [Javassist user questions] - Re: Duplicate a method

2008-02-10 Thread gkorland
The thing is that I want the new method to look the same as the original code, for that I want to copy the original code. The problem is that when I use the: newMethod.setBody(method, null); to copy the original body I need to add the following code to fix the MaxLocals: CodeAttribute

[jboss-user] [Javassist user questions] - How to use an new method argument?

2008-02-08 Thread gkorland
I added a new argument to a method, but I didn't find the a way to use it. How can I use it in the method. Thanks, Guy View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4128012#4128012 Reply to the post :

[jboss-user] [Javassist user questions] - Duplicate a method

2008-02-01 Thread gkorland
Hi, I'm trying to duplicate a method, what is the a best practice? e.g. public void foo(){ some code... } add another duplicate method: public void foo(int i){ some code... } View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4125719#4125719 Reply to the

[jboss-user] [Javassist user questions] - Annotating JDK classes

2007-12-16 Thread gkorland
Hi, I'm trying to annotate all the classes used by the user application, the thing is that even with agentlib there classes that are loaded before the agent. How can I annotate all the classes including the JDK classes? Thanks, Guy View the original post :