尽管Override的时候并不是必须使用这个annotation,使用它还是可以使程序逻辑更明了化,特别是当子类方法的返回值继承自父类方法的返回值。如在上例中,子类的getPreferredFood方法返回Hey的实例,父类的getPreferredFood方法返回Food的实例,其中Hey继承Food。更多信息见Overriding and Hiding Methods。
Set warning level. e.g. -warn:unusedLocal,deprecation
In red are the default settings.
-warn:none disable all warnings -warn:<warnings separated by ,> enable exactly the listed warnings -warn:+<warnings separated by ,> enable additional warnings -warn:-<warnings separated by ,> disable specific warnings
allDeprecation
deprecation even inside deprecated code
allJavadoc
invalid or missing javadoc
assertIdentifier
occurrence of assert used as identifier
boxing
autoboxing conversion
charConcat
when a char array is used in a string concatenation without being converted explicitly to a string
conditionAssign
possible accidental boolean assignment
constructorName
method with constructor name
dep-ann
missing @Deprecated annotation
deprecation
usage of deprecated type or member outside deprecated code
discouraged
use of types matching a discouraged access rule
emptyBlock
undocumented empty block
enumSwitch, incomplete-switch
incomplete enum switch
fallthrough
possible fall-through case
fieldHiding
field hiding another variable
finalBound
type parameter with final bound
finally
finally block not completing normally
forbidden
use of types matching a forbidden access rule
hiding
macro for fieldHiding, localHiding, typeHiding and maskedCatchBlock
indirectStatic
indirect reference to static member
intfAnnotation
annotation type used as super interface
intfNonInherited
interface non-inherited method compatibility
javadoc
invalid javadoc
localHiding
local variable hiding another variable
maskedCatchBlocks
hidden catch block
nls
non-nls string literals (lacking of tags //$NON-NLS-<n>)
noEffectAssign
assignment with no effect
null
missing or redundant null check
over-ann
missing @Override annotation
paramAssign
assignment to a parameter
pkgDefaultMethod
attempt to override package-default method
raw
usage a of raw type (instead of a parametrized type)
semicolon
unnecessary semicolon or empty statement
serial
missing serialVersionUID
specialParamHiding
constructor or setter parameter hiding another field
static-access
macro for indirectStatic and staticReceiver
staticReceiver
if a non static receiver is used to get a static field or call a static method
suppress
enable @SuppressWarnings
syntheticAccess, synthetic-access
when performing synthetic access for innerclass
tasks
enable support for tasks tags in source code
typeHiding
type parameter hiding another type
unchecked
unchecked type operation
unnecessaryElse
unnecessary else clause
unqualified-field-access, unqualifiedField
unqualified reference to field
unused
macro for unusedArgument, unusedImport, unusedLabel, unusedLocal, unusedPrivate and unusedThrown