[JSR308] array-valued annotations

Gary T. Leavens leavens at cs.iastate.edu
Thu Jan 25 17:39:36 EST 2007

Hi Michael, Tom, and all,

On Thu, 25 Jan 2007, Michael Ernst wrote:

> Tom Ball rightly criticizes heterogeneous arrays:
>> Java doesn't
>> support an array whose elements are specified as different types, and
>> neither should its metadata define different constraints on them.
> I agree, but I don't think we have to debate this point, because no one has
> proposed such heterogeneous arrays.  (I did not interpret Gary Leavens's
> email as proposing them.)  The real issue is different levels of the array,
> not different elements at a single level.

Yes, I wasn't arguing that each element of an array be allowed a
different modifier, although I didn't make that very clear.  As Mike
says, I was arguing that one needs to distinguish the field/variable
holding the array reference from the elements of the array.  That was
the point of my picture.

Tom was correctly noting that modifiers like NonNull and Readonly
are part of a type in some sense.  I agree that the different
elements of an array should all be treated in exactly the same way

          Gary T. Leavens
          Department of Computer Science, Iowa State University
          229 Atanasoff Hall, Ames, Iowa 50011-1041 USA
          http://www.cs.iastate.edu/~leavens  phone: +1-515-294-1580

More information about the JSR308 mailing list