-
Notifications
You must be signed in to change notification settings - Fork 2k
Expand file tree
/
Copy pathImplementsAnnotation.qhelp
More file actions
52 lines (38 loc) · 1.41 KB
/
ImplementsAnnotation.qhelp
File metadata and controls
52 lines (38 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<!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>