File: InvalidBlockTag.md

package info (click to toggle)
error-prone-java 2.18.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 23,204 kB
  • sloc: java: 222,992; xml: 1,319; sh: 25; makefile: 7
file content (42 lines) | stat: -rw-r--r-- 826 bytes parent folder | download
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
A non-standard Javadoc block tag was used.

```java
/**
 * @returns two times n
 */
int twoTimes(int n) {
  return 2 * n;
}
```

```java
/**
 * @return two times n
 */
int twoTimes(int n) {
  return 2 * n;
}
```

Note that any Javadoc line starting with `@`, even embedded inside `<pre>` and
`{@code ...}`, is interpereted as a block tag by the Javadoc parser. As such, if
you wish your Javadoc to include a code block containing an annotation, you
should generally avoid `{@code ...}` and instead write the HTML yourself,
manually escaping the `@` entity.

```java
/**
 * Designed to be overridden, such as:
 *
 * <pre>
 * class Foo {
 *   &#64;Override public String toString() {return "";}
 * }
 * </pre>
 */
```

## Suppression

Suppress by applying `@SuppressWarnings("InvalidBlockTag")` to the element being
documented.