Skip to content

Commit 21c190a

Browse files
cushonError Prone Team
authored and
Error Prone Team
committed
Document that javadoc shouldn't appear between annotations and the documented element
PiperOrigin-RevId: 591893421
1 parent d272dfa commit 21c190a

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

docs/bugpattern/javadoc/NotJavadoc.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,23 @@ Suggested solutions:
1414
* If the comment is intended to be an implementation comment, use a
1515
single-line `//` or a multi-line `/*` comment instead.
1616

17+
> NOTE: Javadoc must appear before any annotations, or the compiler will fail to
18+
> recognise it as Javadoc. That is, prefer this:
19+
>
20+
> ```java
21+
> /** Might return a frobnicator. */
22+
> @Nullable
23+
> Frobnicator getFrobnicator();
24+
> ```
25+
>
26+
> instead of this:
27+
>
28+
> ```java
29+
> @Nullable
30+
> /** Might return a frobnicator. */
31+
> Frobnicator getFrobnicator();
32+
> ```
33+
1734
## Suppression
1835
1936
Suppress by applying `@SuppressWarnings("NotJavadoc")` to the enclosing element.

0 commit comments

Comments
 (0)