Review Request: JDK-8220282 Add MethodHandle tests on accessing final fields
Mandy Chung
mandy.chung at oracle.com
Wed Mar 27 02:58:20 UTC 2019
This is a new version of the patch:
http://cr.openjdk.java.net/~mchung/jdk13/webrevs/8220282/webrev.01
I made further clean up to this new test.
It extends MethodHandlesTest.HasFields class to include the test
cases for instance final fields. HasFields is used to test
findGetter/findStaticGetter, findSetter/findStaticSetter, and
unreflectSetter/unreflectGetter.
A new HasFields::testCasesFor(int testMode) method is added to
return the test cases where c[1] == Error.class indicates a
negative test case.
For getters, all HasFields except bogus_xx fields are positive
test cases, i.e. no exception is expected.
For findSetter/findStaticSetter, a final field has no write access
and setting on a final field is a negative test case.
For unreflectSetter, non-final fields and instance final fields
whose accessible flag is true have write access and hence they
are positive test cases whereas static final fields are negative
test cases.
thanks
Mandy
More information about the core-libs-dev
mailing list