当前位置:首页 > 服务端 > @SuppressWarnings(rawtypes)

@SuppressWarnings(rawtypes)

@SuppressWarnings,表示警告抑制,告诉编译器不用提示相关的警告信息。

"rawtypes",这个参数是告诉编译器不用提示使用基本类型参数时相关的警告信息。一般是在通过传参调用某个方法的时候进行标识。

SuppressWarnings中类似的参数还有很多,比如:

  • all: to suppress all warnings
  • boxing: to suppress warnings relative to boxing/unboxing operations
  • cast: to suppress warnings relative to cast operations
  • dep-ann: to suppress warnings relative to deprecated annotation
  • deprecation: to suppress warnings relative to deprecation
  • fallthrough: to suppress warnings relative to missing breaks in switch statements
  • finally: to suppress warnings relative to finally block that don't return
  • hiding: to suppress warnings relative to locals that hide variable
  • incomplete-switch: to suppress warnings relative to missing entries in a switch statement (enum case)
  • javadoc: to suppress warnings relative to javadoc warnings
  • nls: to suppress warnings relative to non-nls string literals
  • null: to suppress warnings relative to null analysis
  • resource: to suppress warnings relative to usage of resources of type Closeable
  • restriction: to suppress warnings relative to usage of discouraged or forbidden references
  • serial: to suppress warnings relative to missing serialVersionUID field for a serializable class
  • static-access: to suppress warnings relative to incorrect static access
  • static-method: to suppress warnings relative to methods that could be declared as static
  • super: to suppress warnings relative to overriding a method without super invocations
  • synthetic-access: to suppress warnings relative to unoptimized access from inner classes
  • sync-override: to suppress warnings because of missing synchronize when overriding a synchronized method
  • unchecked: to suppress warnings relative to unchecked operations
  • unqualified-field-access: to suppress warnings relative to field access unqualified
  • unused: to suppress warnings relative to unused code and dead code

 

 

引用:http://help.eclipse.org/kepler/index.jsp?topic=/org.eclipse.jdt.doc.isv/guide/jdt_api_compile.htm

作者:路要一步一步走
来源链接:https://www.cnblogs.com/king0207/p/14006923.html

版权声明:
1、Java侠(https://www.javaxia.com)以学习交流为目的,由作者投稿、网友推荐和小编整理收藏优秀的IT技术及相关内容,包括但不限于文字、图片、音频、视频、软件、程序等,其均来自互联网,本站不享有版权,版权归原作者所有。

2、本站提供的内容仅用于个人学习、研究或欣赏,以及其他非商业性或非盈利性用途,但同时应遵守著作权法及其他相关法律的规定,不得侵犯相关权利人及本网站的合法权利。
3、本网站内容原作者如不愿意在本网站刊登内容,请及时通知本站(javaclubcn@163.com),我们将第一时间核实后及时予以删除。





本文链接:https://www.javaxia.com/server/125564.html

标签: unused variable
分享给朋友: