Files
codeql/java/ql/src/Advisory/Deprecated Code/AvoidDeprecatedCallableAccess.qhelp
2018-08-30 10:48:05 +01:00

48 lines
1.5 KiB
XML

<!DOCTYPE qhelp PUBLIC
"-//Semmle//qhelp//EN"
"qhelp.dtd">
<qhelp>
<overview>
<p>
A method (or constructor) can be marked as deprecated using either the <code>@Deprecated</code>
annotation or the <code>@deprecated</code> Javadoc tag. Using a method that has been
marked as deprecated is bad practice, typically for one or more of the following reasons:</p>
<ul>
<li>The method is dangerous.</li>
<li>There is a better alternative method.</li>
<li>Methods that are marked as deprecated are often removed from future versions of an API. So using
a deprecated method may cause extra maintenance effort when the API is upgraded.</li>
</ul>
</overview>
<recommendation>
<p>Avoid using a method that has been marked as deprecated. Follow any guidance that
is provided with the <code>@deprecated</code> Javadoc tag, which should explain how to replace the
call to the deprecated method.
</p>
</recommendation>
<references>
<li>
Help - Eclipse Platform:
<a href="http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Freference%2Fpreferences%2Fjava%2Fcompiler%2Fref-preferences-errors-warnings.htm">Java Compiler Errors/Warnings Preferences</a>.
</li>
<li>
Java Platform, Standard Edition 6, API Specification:
<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Deprecated.html">Annotation Type Deprecated</a>.
</li>
<li>
Java SE Documentation:
<a href="http://docs.oracle.com/javase/6/docs/technotes/guides/javadoc/deprecation/deprecation.html">How and When To Deprecate APIs</a>.
</li>
</references>
</qhelp>