Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jdt-core-dev] [pool] Should the new warning for diagnosing unnecessary @SuppressWarnings annotation be enabled by default ?

Recently a new compiler warning got introduced. It got enabled by default,
to match the warning for unhandled warning tokens.
If you feel strongly against enabling this warning by default, please
explain why.

--------------------------
Added new compiler optional warning for diagnosing unnecessary
@SuppressWarnings annotation. This is mostly helpful to get rid of
@SupressWarnings(...) annotations which were necessary a while ago, but are
no longer useful. Note that @SuppressWarnings("all") is still silencing the
warning for unnecessary @SuppressWarnings, as it is the master switch to
silence ALL warnings. Also added option:
JavaCore.COMPILER_PB_UNUSED_WARNING_TOKEN and problem ID
IProblem.UnusedWarningToken.
* COMPILER / Reporting Unnecessary @SuppressWarnings
*    When enabled, the compiler will issue an error or a warning when
encountering @SuppressWarnings annotation
*    for which no corresponding warning got detected in the code. This
diagnostic is provided to help developers to get
*    rid of transient @SuppressWarnings no longer needed. Note that
@SuppressWarnings("all") is still
*    silencing the warning for unnecessary @SuppressWarnings, as it is the
master switch to silence ALL warnings.
*     - option id:
"org.eclipse.jdt.core.compiler.problem.unusedWarningToken"
*     - possible values:   { "error", "warning", "ignore" }
*     - default:           "warning"

(see bug 127533)



Back to the top