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
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
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 :
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));
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(););
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
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 :
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
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 :