webrev for type-annotations, repeating type-annotations test
Alex Buckley
alex.buckley at oracle.com
Thu Jan 10 14:37:29 PST 2013
Hi Steve,
It seems to me there is still quite a lot of code duplication in
ClassfileTestHelper for the 3-arg and 4-arg versions of test().
The writeup of CombinationsTargetTest is helpful, especially the sample
output. It shows there is a lot going on: i) annotation types which are
declaration-site v. use-site v. decl-and-use-site, and ii) annotations
which occur once v. multiple times v. jointly with other annotations.
Two questions:
1. Could you expand "4) inside method bodies" to make clear what
locations are tested with type annotations?
2. Is it possible to "limit" the test generation of
CombinationsTargetTest to just (say) use-site annotations occurring once
in cast expressions ? If a "simple" scenario like that is easy to run
and verify, it would give confidence that complex scenarios like the
sample output are correct.
Alex
On 1/9/2013 5:00 PM, Steve Sides wrote:
> I posted a second webrev,
> http://cr.openjdk.java.net/~ssides/8005085/webrev.02/
> with a webrevComment.txt file and removed the statics. :)
>
> -steve
>
> On 1/9/2013 12:32 PM, Alex Buckley wrote:
>> Hi Steve,
>>
>> Thanks for publishing this webrev. (And congrats on becoming an Author
>> in this project!)
>>
>> CombinationsTargetTest is pretty complicated. Could you please give a
>> description and examples of the combinations it generates?
>>
>> DeadCode, NewTypeArguments, TypeCasts, and Wildcards all use static
>> fields in their superclass (ClassfileTestHelper) to communicate
>> expected results to ClassfileTestHelper.countAnnotations(). Is it
>> necessary to use static fields for this purpose?
>>
>> 8005681 is interesting. You're saying that "new @Foo @Foo @Bar @Bar
>> C()" causes all four annotations to be dropped? Werner cannot access
>> JBS, so it would be helpful if you could send test cases to this list.
>>
>> Alex
>>
>> On 1/8/2013 3:45 PM, Steve Sides wrote:
>>> This test supercedes the test in the previous review request (which was
>>> via mail).
>>> http://cr.openjdk.java.net/~ssides/8005085/
>>>
>>> In writing a test for repeating type annotations I found it could cover
>>> several scenarios in one test, so this coverage
>>> mixed target types on type usages and type parameters as well as
>>> repeating type annotations in those usages.
>>>
>>> Due to http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8005681 a few
>>> scenarios are commented out.
>>> In addition to any other changes or suggestions, we may want for that to
>>> be fixed so the whole test can be considered.
>>>
>>> This also include the previous refactoring of the classfile tests into a
>>> helper, ClassfileTestHelper.java.
>>> This makes the tests much simpler looking and easier to add new tests.
>>>
>>> I'd appreciate any comments or suggestions.
>>>
>>> -steve
>
More information about the type-annotations-dev
mailing list