[Jsr308-statements] Re: [JSR308] Block Annotations Suggestion

Trevor Harmon trevor at vocaro.com
Wed Oct 3 18:21:19 EDT 2007


On Oct 3, 2007, at 1:32 PM, Eduardo Born wrote:

> In the case, I feel that makes the code dirtier to have several  
> repetitions of the same annotation to a group of elements, and that  
> makes the code less readable and maintainable too.

Maybe in some cases, but it could make code less readable, too. I  
often see fields with large chunks of JavaDoc attached to them, and  
with several fields together, they can span a page or more. If you  
were to surround those fields with an annotated block, then the  
annotation will be far removed from the field declaration. It  
wouldn't be clear that the field even has an annotation.

> I think that having a way to apply an annotation not only to a  
> single statement, but to a group of them, would make the statement  
> annotations much more usable.

When I said "usable", I meant able to be used, not just maintainable  
or readable. Field annotations are still perfectly usable, even  
without putting annotated blocks around them.

In other cases, such as loops and statements, annotations are simply  
unusable; there's no support for them whatsoever. I think we should  
focus on those kinds of cases because they have a more substantial  
impact on what annotations can be used for.

Trevor




More information about the JSR308-statements mailing list