File: UnrecognisedJavadocTag.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 (48 lines) | stat: -rw-r--r-- 1,149 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
43
44
45
46
47
48
This Javadoc tag isn't being recognised by the Javadoc parser. This can happen
very easily if the tag is malformed in some way.

Common cases for `{@link` tags include:

*   Mismatched end braces, for example `{@link Foo)`
*   Totally malformed links, for example `{@link #Optional.empty()}` (should be
    `{@link Optional#empty()}`)

Common cases include, for `{@code` tags:

*   The tag not being terminated correctly, i.e. via a parenthesis (`{@code
    foo)`)
*   `{@code` being used where it isn't accepted, e.g. as the first argument to
    `@param` (`@param {@code myParam} a parameter`)
*   Unmatched curly braces in large blocks...

Unmatched curly braces can be particularly hard to spot, e.g.:

```java
/**
 * Should be used like:
 *
 * <pre>{@code
 *   Frobnicator frobnicator = new Frobnicator() {
 * }</pre>
 */
interface Frobnicator {}
```

Which should be:

```java
/**
 * Should be used like:
 *
 * <pre>{@code
 *   Frobnicator frobnicator = new Frobnicator() {
 *   };
 * }</pre>
 */
interface Frobnicator {}
```

## Suppression

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