RFR - 8065552: setAccessible(true) on fields of Class may throw a SecurityException

Seán Coffey sean.coffey at oracle.com
Mon Dec 1 21:09:36 UTC 2014


On 01/12/2014 18:54, Daniel Fuchs wrote:
>> on the test side would it be worth testing all public classes available
>> (e.g in rt.jar ?) to ensure that
>> Field.setAccessible works as expected and that we don't hit this issue
>> again ? It might be some
>> what of a heavy test for jtreg inclusion though.
>
> It could be worth a try. But let's wait until JEP 220 is in.
I'm not sure why JEP 220 would be a factor for now. JDK 8u and 7u are 
the production
JDKs for a while to come. Martin's testcase looks like a good approach. 
I just
ran it through the rt.jar classes and had it test for 
"f.setAccessible(true);" on all
getDeclaredFields in each class. Run time shouldn't be an issue I think 
: (6-7 seconds)

> class load: 19624 classes, 5162.67 ms total time, 0.2631 ms per class
> getMethods: 19624 classes, 1076.00 ms total time, 0.0548 ms per class

regards,
Sean.



More information about the core-libs-dev mailing list