rspec/rules/S1724/rule.adoc

52 lines
1.1 KiB
Plaintext
Raw Normal View History

Deprecated classes and interfaces should be avoided, rather than used, inherited or extended. Deprecation is a warning that the class or interface has been superseded, and will eventually be removed. The deprecation period allows you to make a smooth transition away from the aging, soon-to-be-retired technology.
== Noncompliant Code Example
----
/**
* @deprecated As of release 1.3, replaced by {@link #Fee}
*/@Deprecated
class Foo { ... }
class Bar extends Foo { ... }
----
== Compliant Solution
----
class Bar extends Fee { ... }
----
== Exceptions
When the class that extends a deprecated class is itself deprecated, the extending class will be ignored.
----
@Deprecated
class Bar extends Foo { ... } // compliant Bar is deprecated.
----
== See
2021-10-28 10:07:16 +02:00
* https://cwe.mitre.org/data/definitions/477.html[MITRE, CWE-477] - Use of Obsolete Functions
2022-01-25 18:36:46 +01:00
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::message.adoc[]
'''
== Comments And Links
(visible only on this page)
include::comments-and-links.adoc[]
endif::env-github,rspecator-view[]