[Nestmates] RFR: 8189158: [Nestmates] Expand test coverage

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Wed Oct 11 08:16:51 UTC 2017


Hi David,
in general seems great, but I do have a question:

in privateMethods/TestReflection, what is the goal of this repetition:

void access_priv(TestReflection o) throws Throwable {
*o.getClass()*.getDeclaredMethod("priv_invoke", new 
Class<?>[0]).invoke(o, new Object[0]);
*TestReflection.class*.getDeclaredMethod("priv_invoke", new 
Class<?>[0]).invoke(o, new Object[0]);
}

I could get this if 'o' had a different class than TestReflection.class 
(e.g. a subclass) - but that doesn't seem to be the case in the test 
(other test methods are similarly behaved). This means that the test is 
basically just making sure that o.getClass() (where o is 
TestReflection.class) and TestReflection.class yields the same Class 
instance. Which should not increase test coverage w.r.t. nestmatest? Am 
I missing something?

Cheers
Maurizio


On 11/10/17 08:43, David Holmes wrote:
> webrev: http://cr.openjdk.java.net/~dholmes/8189158/webrev/
>
> Reflection tests need to be run in such a way to check both the native 
> accessors and the generated accessors.
>
> Reflection should check static class and o.getClass
>
> TestInvokeHierarchy needs a reflection and MethodHandles version.
>
> Thanks,
> David
>



More information about the valhalla-dev mailing list