mirror of
https://github.com/github/codeql.git
synced 2026-02-23 02:13:41 +01:00
Where possible update Java documentation links to Java 11. Additionally update some other links to use HTTPS.
53 lines
1.4 KiB
XML
53 lines
1.4 KiB
XML
<!DOCTYPE qhelp PUBLIC
|
|
"-//Semmle//qhelp//EN"
|
|
"qhelp.dtd">
|
|
<qhelp>
|
|
|
|
|
|
<overview>
|
|
<p>Although an annotation type is a special kind of interface that
|
|
can be implemented by a concrete class, this is not its intended use.
|
|
It is more likely that an annotation type should be used to annotate a class.
|
|
</p>
|
|
|
|
</overview>
|
|
<recommendation>
|
|
|
|
<p>Ensure that any annotations are used to annotate a class, unless they are really supposed to be
|
|
extended or implemented by the class.
|
|
</p>
|
|
|
|
</recommendation>
|
|
<example>
|
|
|
|
<p>In the following example, the annotation <code>Deprecated</code> is implemented by the class
|
|
<code>ImplementsAnnotation</code>.</p>
|
|
|
|
<sample src="ImplementsAnnotation.java" />
|
|
|
|
<p>The following example shows the intended use of annotations: to annotate the class
|
|
<code>ImplementsAnnotationFix</code>.</p>
|
|
|
|
<sample src="ImplementsAnnotationGood.java" />
|
|
|
|
</example>
|
|
<references>
|
|
|
|
|
|
<li>
|
|
Java Language Specification:
|
|
<a href="https://docs.oracle.com/javase/specs/jls/se11/html/jls-9.html#jls-9.6">Annotation Types</a>.
|
|
</li>
|
|
<li>
|
|
The Java Tutorials:
|
|
<a href="https://docs.oracle.com/javase/tutorial/java/annotations/index.html">Annotations</a>.
|
|
</li>
|
|
<li>
|
|
Help - Eclipse Platform:
|
|
<a href="https://help.eclipse.org/2020-12/advanced/content.jsp?topic=/org.eclipse.jdt.doc.user/reference/preferences/java/compiler/ref-preferences-errors-warnings.htm">Java Compiler Errors/Warnings Preferences</a>.
|
|
</li>
|
|
|
|
|
|
</references>
|
|
</qhelp>
|