Annotation SOURCE Retention Policy

前端 未结 2 1336
無奈伤痛
無奈伤痛 2021-01-01 11:08

From the Java doc:

CLASS: Annotations are to be recorded in the class file by the compiler but need not be retained by the VM at run time.

RUNTIME:

2条回答
  •  伪装坚强ぢ
    2021-01-01 11:54

    This answer makes perfect sense - https://stackoverflow.com/a/43910948/3009968.

    You would not like to include a dependency, the desired effects of which are realized even before the code is compiled. E.g. @SuppressWarnings

    You would not like to include a dependency which is used by compiler to let's say generate code but not at all required during runtime. E.g. as mentioned already in previous answer -spring roo.

提交回复
热议问题