RFR: 7103570 AtomicIntegerFieldUpdater does not work when SecurityManager is installed
david.holmes at oracle.com
Thu Apr 19 04:35:15 PDT 2012
Basic fix is to call getDeclaredField() inside a doPrivileged block.
In addition the call to checkPackageAccess is now conditional - it
allows for, for example, a class in sun.misc to create a field updater
for another class in sun.misc.
Finally the @throws spec for newUpdater has been expanded to say:
@throws RuntimeException with a nested reflection-based
exception if the class does not hold field or is the wrong type,
+ or the field is inaccessible to the caller according to Java language
+ access control
This last part requires CCC approval which I will initiate.
I have a glitch with running the test under jtreg but hopefully that
will get sorted soon (jtreg fails if a security manager is installed).
More information about the core-libs-dev