rspec/rules/S1724/rule.adoc
Fred Tingaud 16f6c0aecf
Inline adoc when include has no additional value (#1940)
Inline adoc files when they are included exactly once.

Also fix language tags because this inlining gives us better information
on what language the code is written in.
2023-05-25 14:18:12 +02:00

61 lines
1.2 KiB
Plaintext

== Why is this an issue?
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
[source,text]
----
/**
* @deprecated As of release 1.3, replaced by {@link #Fee}
*/@Deprecated
class Foo { ... }
class Bar extends Foo { ... }
----
=== Compliant solution
[source,text]
----
class Bar extends Fee { ... }
----
=== Exceptions
When the class that extends a deprecated class is itself deprecated, the extending class will be ignored.
[source,text]
----
@Deprecated
class Bar extends Foo { ... } // compliant Bar is deprecated.
----
== Resources
* https://cwe.mitre.org/data/definitions/477[MITRE, CWE-477] - Use of Obsolete Functions
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
=== Message
"XXX" is deprecated, [extend|implement] the suggested replacement instead.
'''
== Comments And Links
(visible only on this page)
=== is related to: S2214
endif::env-github,rspecator-view[]