@Documented @Retention(value=SOURCE) @Target(value={ANNOTATION_TYPE,CONSTRUCTOR,FIELD,LOCAL_VARIABLE,METHOD,PACKAGE,PARAMETER,TYPE}) public @interface Warning
@Warning("dead code")
Warns that a particular piece of code is no longer used, or never was used. It should be tested and possibly modified before use.
@Warning("init call") // final method
Warns that the method is called from a constructor or other initializer where the call is not dynamically bound. Often the method will have a final modifier to preclude overriding, even if it happens to be private or implicitly final in the current revision of the code.
@Warning("untested")
Warns that a particular piece of code has never been tested.
@Warning("non-API") // non-private member typically
Warns that the member is only for internal use. It is not part of the application programming interface.
@Warning("thread restricted object") // field, constructor, method @Warning("thread restricted elements") // field, constructor, method that dispenses an array // or collection of elements
The first version warns that objects read from the field, or created by the constructor, or returned by the method are not thread safe. Though the field, constructor or method may itself be thread safe, the objects it dispenses are not. The programmer is warned to consult the objects' own type API for the detailed restrictions. (See also @ThreadRestricted.) The second version provides the same warning, but with regard to the elements of the object.
@Warning("thread restricted object, restriction") // field, constructor, method @Warning("thread restricted elements, restriction") // field, constructor, method that dispenses an array // or collection of elements
These are the same as the previous warnings, only they specify the restriction.