Skip to content

Files

Latest commit

 

History

History
27 lines (20 loc) · 706 Bytes

provide_deprecation_message.md

File metadata and controls

27 lines (20 loc) · 706 Bytes

Pattern: Missing deprecation message

Issue: -

Description

DO specify a deprecation message (with migration instructions and/or a removal schedule) in the Deprecation constructor.

Example of incorrect code:

@deprecated
void oldFunction(arg1, arg2) {}

Example of correct code:

@Deprecated("""
[oldFunction] is being deprecated in favor of [newFunction] (with slightly
different parameters; see [newFunction] for more information). [oldFunction]
will be removed on or after the 4.0.0 release.
""")
void oldFunction(arg1, arg2) {}

Further Reading