RFR: 8065172: More core reflection final and volatile annotations

Martin Buchholz martinrb at google.com
Mon Dec 8 20:31:13 UTC 2014

(sorry for missing this message earlier)

On Tue, Dec 2, 2014 at 1:49 AM, Paul Sandoz <paul.sandoz at oracle.com> wrote:

>> http://cr.openjdk.java.net/~martin/webrevs/openjdk9/core-reflection-more-safety/
> I am not convinced about the use of CAS. If we can get away with just volatile fields I think the code is simpler. Are you concerned there are cases of identity and mutability?

Yes, I'm trying to write this code in the safest possible way, never
for example returning distinct but equivalent Type objects to a user,
possibly triggering very obscure bugs in non-jdk code.  If this code
is not performance crititcal (which I believe to be true), doing it
this way seems best.  If it is performance crititcal, we can switch to
Unsafe CAS or even use Unsafe CAS plus risky relaxed reads as Peter
has suggested (which would improve performance on weak-memory-model
platforms as seen on other email threads).

> All other aspects look good.

More information about the core-libs-dev mailing list