From: MarlonBrando on
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
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
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? :-)


First  |  Prev  | 
Pages: 1 2
Prev: final methods and classes
Next: struts2 + netbeans