Type annotations on inner type that is an array components

B. Blaser bsrbnd at gmail.com
Mon Jul 30 16:23:49 UTC 2018

On 30 July 2018 at 12:50, B. Blaser <bsrbnd at gmail.com> wrote:
> Hi Werner,
> On 30 July 2018 at 05:31, Werner Dietl <wdietl at gmail.com> wrote:
>> Thanks to Liam for pointing out how to run the tests and, of course, I
>> had missed a case: annotations on the array dimensions.
>> I re-added the arrayTypeTree helper method that was removed in
>>   http://hg.openjdk.java.net/jdk9/dev/langtools/rev/62e285806e83
>> and tier1 tests are now clean, except for some failures that already
>> existed for me.
>> Updated patch below.
> I discovered the suspicious change-set after having submitted the
> first patch as initial direction to search, but I was also septic that
> it might be the final solution...
> I'll take a look at your suggestion and give you my feedback soon.
> Maybe examining existing tests ([1],[2],...) and adding missing cases
> would be interesting too?

I've attached your latest patch updated as follows:
* removed the unnecessary loop on array elements (replaced by
recursion on 'typeWithAnnotations()')
* added the 'onlyTypeAnnotations' parameter to 'rewriteArrayType()'
* dropped cosmetic changes (indentation & dead code removal) which can
be later reinstated
* added some test cases

Tier1 is OK (without any failure) but note the different output for
'T6747671.java' which probably means that the fix has side-effects.

What do you think?


> Thanks!
> Bernard
> [1] http://hg.openjdk.java.net/jdk/jdk/file/b7a307084247/test/langtools/tools/javac/annotations/typeAnnotations/referenceinfos
> [2] http://hg.openjdk.java.net/jdk/jdk/file/b7a307084247/test/langtools/tools/javac/annotations/typeAnnotations/referenceinfos/Fields.java
>> Best,
>> cu, WMD.
>> --
>> http://www.google.com/profiles/wdietl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jdk8208470b.patch
Type: text/x-patch
Size: 7047 bytes
Desc: not available
URL: <http://mail.openjdk.java.net/pipermail/compiler-dev/attachments/20180730/3c294789/jdk8208470b-0001.patch>

More information about the compiler-dev mailing list