File: DoNotClaimAnnotations.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 (8 lines) | stat: -rw-r--r-- 609 bytes parent folder | download
1
2
3
4
5
6
7
8
Do not 'claim' annotations in annotation processors; [`Processor#process`]
should unconditionally `return false`. Claiming annotations prevents other
processors from seeing the annotations, which there's usually no reason to do.
It's also fragile, since it relies on the order the processors run in, and
there's no robust way in most build systems to ensure a particular processor
sees the annotations first.

[`Processor#process`]: https://docs.oracle.com/en/java/javase/11/docs/api/java.compiler/javax/annotation/processing/Processor.html#process(java.util.Set,javax.annotation.processing.RoundEnvironment)