@SuppressWarnings(rawtypes)

举报
liuzhen007 发表于 2021/05/28 04:44:16 2021/05/28
【摘要】 @SuppressWarnings,表示警告抑制,告诉编译器不用提示相关的警告信息。 "rawtypes",这个参数是告诉编译器不用提示使用基本类型参数时相关的警告信息。一般是在通过传参调用某个方法的时候进行标识。 SuppressWarnings中类似的参数还有很多,比如: all: to suppress all warningsboxing: to suppres...

@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

 

文章来源: liuzhen.blog.csdn.net,作者:Data-Mining,版权归原作者所有,如需转载,请联系作者。

原文链接:liuzhen.blog.csdn.net/article/details/90790575

【版权声明】本文为华为云社区用户转载文章,如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@huaweicloud.com
  • 点赞
  • 收藏
  • 关注作者

评论(0

0/1000
抱歉,系统识别当前为高风险访问,暂不支持该操作

全部回复

上滑加载中

设置昵称

在此一键设置昵称,即可参与社区互动!

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。