some more fiddling
michael keith
michael.keith at oracle.com
Thu Jan 24 13:16:18 PST 2013
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. 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 :-)
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?
Thanks,
-Mike
More information about the enhanced-metadata-spec-discuss
mailing list