[Checkers] Q about new JSR 308 proposal

Mahmood Ali mahmood at MIT.EDU
Thu Sep 4 13:51:01 EDT 2008

Greetings Mike,

I am going through the new JSR 308 proposal and it seems that I have a  
misunderstanding regarding array syntax.

__ New Proposal __
To more fully describe a particular array, a programmer might say "non- 
null array of length-10 arrays of English Strings". The prefix  
notation naturally fits the way a programmer reads a Java type: this  
type is declared as

declaration:       @English String  @NonNull [] @Length(10) []

order of reading:  2------------->  1 ----------------------->

and is read in exactly the same order as before.

__ My previous understanding __
I thought that you would read a string array (even before using  
annotations) as:
declaration:        @English String  @NonNull [] @Length(10) []
order of reading:   3--------------> 2---------> 1------------->

So it would be "length-10 array of non-null array of English String."

This is how I described it in the manual previously.

__ Criticism __
The new proposal now has the same problem it tries to solve.  Namely,  
given the following declaration:
   @English String @NonNull []   arr1,   arr2 @Length(10) [];
In the proposed syntax, the types would be:
arr1:   nonnull array                    of English string
arr2:   nonnull array of length-10 array of English string

While in my thinking the types would be
arr1:                     nonnull array of English string
arr2:  length-10 array of nonnull array of English string

The second understand seems to be more natural.  Are there other  
things in consideration that I am missing?


More information about the checkers mailing list