Annotation Processing and the Pernicious // TODO
Raise your hand if you’ve ever put a // TODO comment in your source code. Or // FIXME, // XXX, or any of the thousands of other variants programmers have been using since before there was dirt to mark places that need further work.
Now raise your hand if your compiler or build tool can tell you about them.
That’s been a personal itch of mine for a while, so I took the chance to scratch it and learn the Java annotation processing API at the same time. The result: TODO Annotations, a set of annotations intended to replace // TODO comments with something easier to check. Now I can have my build server complain and die when FIXMEs go un-fixed without imposing the same stricture on my development environment.
You can grab the source and bang on it – it provides a decent “hello world” example of working with the compiler. For more information on what the API can do, check the annotation processing API, as well as the language model API, and the Annotation Processing Tool docs. Patches, bug reports, and feedback are always welcome. Binaries are also available in the Maven repository.
Or, you can use the Maven taglist plugin – but then you’re stuck with Maven.
