RFR (S) 9 and 8u: JDK-8038994: AnnotatedType.getType() of a TypeVariable boundary without annotations return null
Paul Sandoz
paul.sandoz at oracle.com
Thu May 15 10:30:02 UTC 2014
On May 14, 2014, at 8:01 PM, Joel Borggren-Franck <joel.franck at oracle.com> wrote:
> Hi,
>
> Here is a fix for: https://bugs.openjdk.java.net/browse/JDK-8038994
>
> In short, getAnnotatedFoo.getType() is supposed to return the same Type
> as getGenericFoo(). This wasn't the case for a type variable bound
> without an annotation previously.
>
> Also cleaned up an allocation while in the neighborhood.
>
> Webrev here: http://cr.openjdk.java.net/~jfranck/8038994/webrev.00/
>
The non test code looks good to me:
Not totally sure about the test approach:
48 @Test(dataProvider = "data")
49 public void testClass(Class<?> c, String method) throws Exception {
50 if (c.getTypeParameters().length == 0)
51 return;
60 @Test(dataProvider = "data")
61 public void testMethod(Class<?>c, String method) throws Exception {
62 if ("".equals(method))
63 return;
That's gonna produce redundant results in test reports for stuff that is filtered out by the test method.
Perhaps split the data provider into two, one for classes and one for methods, and replace the if statements with asserts?
Paul.
More information about the core-libs-dev
mailing list