some more fiddling

Joe Darcy joe.darcy at
Thu Feb 21 12:23:15 PST 2013

Hello Mike,

Following up on this thread...

On 1/24/2013 2:14 PM, Joe Darcy wrote:
> Hi Mike,
> On 1/24/2013 1:16 PM, michael keith wrote:
>> So I did some playing around with b72 in a couple of ways.
>> First, I went and modified all of the current JPA container 
>> annotations to be JDK 8 repeatable (using @ContainerFor and 
>> @ContainedBy, since @Repeatable did not seem to be included) and 
>> compiled it using b72. 
> The transition to the simplified @Repeatable model is happening in 
> stages.  Build 73 of JDK 8 has the Repeatable type,  but no compiler 
> and reflection support.   The compiler support is in the team 
> repository now (bug 8006119) and should appear in a near-future 
> promoted build.  However, the core reflection changes to revert back 
> to the JDK 7 and earlier behavior are not implemented yet.
>> Then I took the JPA RI (EclipseLink) code and its existing JPA tests 
>> and built them using JDK 1.7_11. I then ran the tests using b72 and 
>> found that all of the tests passed, so basically existing code and 
>> test cases compiled using a previous JDK will continue to work (at 
>> least in the test cases that I ran). So the first "do no harm" test 
>> seems to have passed :-)
> Good to hear :-)
>> The next thing I did was up the ante and move on to creating tests 
>> using new features (e.g. repeating annotations) to see how compatible 
>> the code would be. In other words, I wanted to make sure the same 
>> processing code could handle repeating annotations using the old API. 
>> It turned out not to work, though, so either the compatibility layer 
>> that we discussed before Christmas isn't done yet, or the current 
>> support just doesn't work as expected. For example, invoking 
>> getAnnotation(Foo.class) on both
>> @Foo(1) @Foo(2)
>> class A {}
>> and
>> @FooContainer({@Foo(1), @Foo(2)})
>> class A {}
>> both returned @Foo(1). In both of these cases it should have returned 
>> null.
>> This, combined with the fact that the Repeatable annotation was not 
>> shipped in b72 leads me to believe that the compatibility support is 
>> still forthcoming. Do you folks have any estimates for when it will 
>> be ready to try out?
> The core reflection changes should be in a promoted build within a few 
> weeks.

The core reflection changes in question to revert the behavior of the 
existing AnnotatedElement methods to be oblivious to repeatability are 
in the current build of JDK 8, b77.

Please re-run your experiments to see if the existing processing code 
works running under JDK 8 with annotation types that have been upgraded 
to be @Repeatable. (There is an in-progress rename of some of the new 
methods, but that won't affect this experiment.)



More information about the enhanced-metadata-spec-discuss mailing list