how is java annotation represented in java bytecode

大憨熊 提交于 2019-12-23 08:46:30

问题


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?


回答1:


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)



来源:https://stackoverflow.com/questions/12368137/how-is-java-annotation-represented-in-java-bytecode

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!