[JSR308] Wishlist: IDE support for annotations & annotation processors
mernst at cs.washington.edu
Thu Jul 16 16:02:37 EDT 2009
What features would you like an IDE to provide, that would make it easier
for you to use annotations and annotation processors? This applies to both
type annotations and to the older Java 5 annotations.
Background: The NetBeans team at Sun is working on improving NetBeans'
support for annotations and annotation processors. NetBeans will soon
support the type annotations syntax (JSR 308). However, NetBeans does not
have any explicit support for running annotation processors. We have the
opportunity to provide a wishlist for NetBeans and for other IDEs.
On a related note, Stephan Heiss reports that the tIDE opensource Java IDE
supports the Checker Framework. I expect him to send an announcement to
this mailing list sometime soon.
Please comment on and extend the below wishlist of IDE features.
Running an annotation processor:
* The user can nominate one or more annotation processors to be run, and
can specify where to find them. These are run every time that the
compiler runs (e.g., on every save).
* The user can easily turn specific annotation processors on and off -- for
instance, to avoid distraction when in the middle of a breaking change.
* The IDE shows red squiggly lines (or its usual indication of compiler
errors) when any checking processor has issued warnings/errors.
Keeping annotations consistent
* When code completion inserts a template for an overriding method, all
annotations are copied down from the overridden method implementation.
The user may then edit them if desired.
(Maybe customize this per-annotation -- some are copied down by default,
others are not.)
* The user can click on a class (or a method) and copy all of its
annotations down to all of its subclasses (or the method implementations
that override it). This is useful when annotating a new codebase:
after adding an annotation on a superclass, you may need to add exactly
the same annotation to every one of its subclasses. IDE support for
this repetitive task would be welcome.
* Wrap the Checker Framework as a NetBeans module available from the NetBeans
update center, to make it easier for users to obtain and use.
More information about the JSR308