Questions regarding the locations inside the class file attributes

1 view
Skip to first unread message

Olivier

unread,
Nov 9, 2009, 12:04:41 PM11/9/09
to Type annotations (JSR 308) discussions
Hi,

I am looking at the specification page 12, I'd like to get some
clarifications.

Annotation location length location
@A not applicable
@B 1 0
@C 3 0, 0, 3
@D 2 0, 0
@E 3 0, 0, 1
@F 3 0, 0, 2
@G 1 1
@H 2 1, 0

I wonder why the locations are not the followings:
for @E: 3 0,0,0
for @F: 3, 0,0,1
for @C: 3, 0,0,2

If I look at the previous examples, they all seem to be 0-based. Why
this would not be the case for:
@A Map<@B Comparable<@C Objec @D[] @E[] @F[]>, @G Lis<@H Document>>.

I thought that the lower left leaf node would always be: 0, 0, 0,..
depending on the depth of the location.

Did I miss something ?

Thanks for any clarification,

Olivier

Mahmood Ali

unread,
Nov 9, 2009, 12:21:07 PM11/9/09
to jsr308-...@googlegroups.com
Greetings,

Good catch. It's a typo. It should be (as you pointed out):


> for @E: 3 0,0,0
> for @F: 3, 0,0,1
> for @C: 3, 0,0,2

I will update the spec. The implementation is doing the proper thing!

Also, I want to think you for catching and reporting our shortcomings
with the specification. Please continue to do so and contribute to
the proposal.

Regards,
Mahmood

Olivier

unread,
Nov 13, 2009, 10:56:03 AM11/13/09
to Type annotations (JSR 308) discussions
On Nov 9, 12:21 pm, Mahmood Ali <mahm...@notnoop.com> wrote:
> Good catch.  It's a typo.  It should be (as you pointed out):
Ok, good.

> Also, I want to think you for catching and reporting our shortcomings
> with the specification.  Please continue to do so and contribute to
> the proposal.
I am going through the specification right now and I think the
following thing could be added to improve clarity:
1) section 4.3.3: it should clearly state that the index for the
method parameters is 0-based. This seems obvious because all indexes
are 0-based, but a specification should make it clear and explicit.
Same remark for the type_index in section 4.3.8.
2) All sections 4.3.x should contain an example of code that leads the
compiler to produce this entry in the class file. Most do, but it
would be good to have an example for each section.

I will report all findings to this list.

Regards,

Olivier
Reply all
Reply to author
Forward
0 new messages