如何具体抑制“比较相同的表达”在Eclipse-Helios JDT中 [英] How to specifically suppress "Comparing identical expressions" in Eclipse-Helios JDT

查看:160
本文介绍了如何具体抑制“比较相同的表达”在Eclipse-Helios JDT中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试使用

    @SuppressWarnings("compareIdentical")

但这不起作用(更糟糕的是,注释结果自己的不支持@SuppressWarnings(compareIdentical)警告!)

but this does not work (worse yet, the annotation results in its own Unsupported @SuppressWarnings("compareIdentical") warning!)

我知道我可以随时使用

    @SuppressWarnings("all")

但是会更多的警告抑制比我想要的。

but that'd be more warning-suppression than I want.

FWIW,我从 http://help.eclipse.org/helios/index.jsp?topic= /org.eclipse.jdt.doc.isv/guide/jdt_api_compile.htm (一个冰雹通行证,确定)。

FWIW, I got the "compareIdentical" string from the "Warning Options" table in http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse.jdt.doc.isv/guide/jdt_api_compile.htm (a hail-mary pass, to be sure).

谢谢! / p>

Thanks!

推荐答案

可以在 SuppressWarning 注释中使用的令牌列表on是:

The list of tokens that can be used inside an SuppressWarning annotation is:


  • all 可以抑制所有警告

  • 拳击以禁止相对于拳击/拆箱操作的警告

  • cast 禁止相对于演员操作的警告

  • dep-ann 可以抑制相对于弃用注释的警告

  • deprecation 以禁止相对于弃用的警告

  • fallthrough to禁止相对于switch语句中缺少中断的警告

  • finally 可以抑制相对于不返回的finally块的警告

  • 隐藏以遏制相对于隐藏变量的本地人的警告

  • 不完全开关可以禁止相对于switch语句(枚举大小写)中缺少的条目的警告。

  • nls 以抑制警告相对于非nls字符串文字

  • null 以抑制警告r

  • raw 可以抑制相对于使用原始类型的警告

  • 限制以禁止使用不鼓励或禁止的引用的警告

  • serial to禁止相对于可序列化类的缺少serialVersionUID字段的警告

  • static-access 可抑制相对于不正确的静态访问的警告

  • 超级可以抑制相对于超越无法超调的方法的警告

  • -access 来抑制相对于内部类的未优化访问的警告

  • 未选中以禁止相对于未选中的警告

  • 不合格的现场访问以禁止相对于现场访问的警告不合格

  • unused 来抑制相对于未使用的代码和死码的警告

  • 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)
  • nls to suppress warnings relative to non-nls string literals
  • null to suppress warnings relative to null analysis
  • raw to suppress warnings relative to usage of raw types
  • 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
  • super to suppress warnings relative to overriding a method without super invocations
  • synthetic-access to suppress warnings relative to unoptimized access from inner classes
  • 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

没有什么可以帮助你。

这篇关于如何具体抑制“比较相同的表达”在Eclipse-Helios JDT中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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