[lworld] setAccessible change and VarHandle test update

mandy chung mandy.chung at oracle.com
Tue Mar 6 23:40:57 UTC 2018


Paul, I have updated VarHandleTestAccess* tests for value class. UOE is 
thrown when it attempts to set the value instance field via VarHandle. 
OTOH the exception message is empty and I have created JDK-8199149 to 
improve the exception message e.g. indicating it's a value class. Any 
other tests should be updated? This patch also updates the following: - 
Constructor::newInstance throws IAE on value class. Field::set* already 
throws IAE in lworld branch. - Constructor::setAccessible(true) throws 
IOE on value class. - Field::setAccessible(true) throws IOE on value 
instance fields and static final fields. - similarly trySetAccessible() 
returns false for the above cases. Value class is new and this is a good 
opportunity to enforce final is final on value classes. So setAccessible 
is not supported on static final and instance fields on value types.I 
disable verification and make the tests to run in -Xint temporarily 
until the lworld support is making further progress. Webrev: 
http://cr.openjdk.java.net/~mchung/valhalla/webrevs/lworld-reflection-varhandles/ 
Thanks Mandy




More information about the valhalla-dev mailing list