Prev: final methods and classes
Next: struts2 + netbeans
From: MarlonBrando on 15 Oct 2009 10:44 On 10æ15æ¥, ä¸å10æ¶07å, Marcin Rzeźnicki <marcin.rzezni...(a)gmail.com> wrote: > On 15 Paź, 15:42, MarlonBrando <beneo99...(a)gmail.com> wrote: > > > the asm-guider.pdf said: [This means that annotations and attributes, > > if any, must be visited first, followed > > by the methodâs bytecode] > > > plz help me.. > > I am not sure whether I understand fully your problem, but the way I > see it the order of attributes is not important.
From: MarlonBrando on 15 Oct 2009 10:45 On 10ÔÂ15ÈÕ, ÏÂÎç9ʱ42·Ö, MarlonBrando <beneo99...(a)gmail.com> wrote: > the asm-guider.pdf said: [This means that annotations and attributes, > if any, must be visited first, followed > by the method's bytecode] > > but when i use it, for example > > MethodVisitor mv = new CheckMethodAdapter(cw.visitMethod( > ACC_PUBLIC, "get" + Helper.capitalize(property), > "()Ljava/lang/String;", null, null)); > mv.visitAttribute(new MethodAttribute(cw)); > mv.visitCode(); > mv.visitVarInsn(ALOAD, 0); > mv.visitFieldInsn(GETFIELD, Type.getType(clazz) > .getInternalName(), property, Type > .getDescriptor(AtomicLong.class)); > // mv.visitInsn(LCONST_0); > mv.visitMethodInsn(INVOKEVIRTUAL, Type.getType > (AtomicLong.class) > .getInternalName(), "get", "()J"); > mv.visitMethodInsn(INVOKESTATIC, Type.getType(Long.class) > .getInternalName(), "valueOf", "(J)Ljava/lang/ > Long;"); > mv.visitMethodInsn(INVOKESTATIC, Type.getType > (MonitorUtil.class) > .getInternalName(), "getFormatedMonitor", > "(Ljava/lang/Long;)Ljava/lang/String;"); > mv.visitInsn(ARETURN); > mv.visitMaxs(2, 1); > mv.visitEnd(); > > i found the code order and the attribute order are reverse, using the > bytecode tool [jclasslib] > just looked like this: > > ..............Methods > + [o] <init> > - [1] getState > - [0] > org.aspectj.weaver.MethodDeclarationLineNumber > - [1] code > > however, it should be : > > - [1] getState > - [0] code > - [1] > org.aspectj.weaver.MethodDeclarationLineNumber > > plz help me.. order is not problem. i wrote a interface in bytecode. oops
From: Marcin Rzeźnicki on 15 Oct 2009 10:50
On 15 Paź, 16:45, MarlonBrando <beneo99...(a)gmail.com> wrote: > On 10æ15æ¥, ä¸å9æ¶42å, MarlonBrando <beneo99...(a)gmail.com> wrote: > > > plz help me.. > > order is not problem. > So how can I help you, sir? :-) |