[type-annos-observers] Comments and questions on JSR 308 draft from January 23, 2013

Michael Ernst mernst at cs.washington.edu
Thu Mar 28 21:22:41 PDT 2013


Joe-

Thanks for your comments on the JSR 308 specification; they're very useful.

I have addressed most of them in the specification, and I won't respond to
those by email.  But I'll follow up on a few others.

This first message is a request for more information on two points.


> "It is permitted to explicitly declare the method receiver as the first
> formal parameter. (Each non-static method
> has an implicit formal parameter, this, which is called the receiver.)
> Then, no special syntax is needed for
> expressing a receiver type annotation: it is simply an annotation on the
> type of the this formal parameter."
>
> "The optional receiver parameter has no effect on execution ― it only
> serves as a place to write annotations
> on the receiver. The compiler generates the same bytecodes, and reflection
> returns the same results regarding
> number of method formal parameters, whether or not the optional receiver
> parameter is present."
>
> In Java SE 8, we are also adding support for more reflective information
> about method and constructor parameters, including modifiers as to whether
> or not they are "synthetic" vs "mandated". The explicit "receiver"
> parameter declarations may alter how the corresponding
> java.lang.reflect.Parameter objects should behave in some situations. In
> any case, the specification should be updated to be explicit about any
> interaction or non-interaction here.

Can you point me at the specification?  (I don't see a reference to this in
lambda, so it must be separate.)

Also, I suspect you may have an opinion about the interaction or
non-interaction.  If you can share that, it would be very helpful.


> Section 3
>
> "The VM does not have to validate all the constraints in Section 3.3, such
> as that offsets point to the right type of
> instruction. The VM does not do format checking (JVMS 4.8) on attributes
> used solely for reflection."
>
> The JVMS has a rich terminology in terms of what checks happen (or not)
> where and when in the linking and loading process. This description above
> should be tied more directly to the JVMS concepts.

Can you give specific, constructive suggestions for the terminology?  You
can probably do that quickly and easily.  Thanks!


Thanks in advance for the info about these two points.

		    -Mike


More information about the type-annotations-spec-observers mailing list