Problem with generating method
| Newsgroups | gmane.comp.java.objectweb.asm |
|---|---|
| Message-ID | <[email protected]> |
i succeded in creating main method, and constructor
but now i need to create new static method
suppose i want do method:
static public f(int x, int y)
{
return x*y;
}
based on my experience with other methods i wrote:
mv = cw.visitMethod( Opcodes.ACC_PUBLIC+Opcodes.ACC_STATIC,
f,"(II)I",null,null);
mv.visitCode();
mv.visitVarInsn(Opcodes.ILOAD, 0);
mv.visitVarInsn(Opcodes.ILOAD, 1);
mv.visitInsn(Opcodes.IMUL);
mv.visitInsn(Opcodes.RETURN);
mv.visitMaxs(0, 0);
mv.visitEnd();
disassebled code for this method is looks exactly as that one created from
source code
bur when i try run class (without using that method)
a get
(class: myClass, method: f signature (II)I) Wrong return type in function
can somebody tells me whad did i miss
regards
message-footer.txt
(text/plain, 238 B)
-- You receive this message as a subscriber of the [email protected] mailing list. To unsubscribe: mailto:[email protected] For general help: mailto:[email protected]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws