java注解在java字节码中是如何表示的 [英] how is java annotation represented in java bytecode

查看:29
本文介绍了java注解在java字节码中是如何表示的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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).

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

As metadata, how are annotations represented in bytecode?

推荐答案

注解出现在与它相关联的事物的字节码之前.如果您没有看到注释,则可能是旧的反编译器(大多数是)

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)

这篇关于java注解在java字节码中是如何表示的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆