如何在java字节码中表示java注释

时间:2021-08-28 16:53:55

I tried to decompile a .class file that contains JUnit tests. I read the byte code, but I did not see any clue of the @Test annotation(it's used in the java source code).

我试图反编译包含JUnit测试的.class文件。我读了字节码,但是我没有看到@Test注释的任何线索(它在java源代码中使用)。

As metadata, how are annotations represented in bytecode?

作为元数据,如何在字节码中表示注释?

1 个解决方案

#1


7  

Annotations appear just before the byte code of the thing it is associated with. If you are not seeing the annotations it could be an old de-compiler (most of them are)

注释出现在与其关联的事物的字节代码之前。如果你没有看到注释,它可能是一个旧的反编译器(大多数都是)

#1


7  

Annotations appear just before the byte code of the thing it is associated with. If you are not seeing the annotations it could be an old de-compiler (most of them are)

注释出现在与其关联的事物的字节代码之前。如果你没有看到注释,它可能是一个旧的反编译器(大多数都是)