RFR: 8062771: Core reflection should use final fields whenever possible

Martin Buchholz martinrb at google.com
Thu Nov 6 19:51:02 UTC 2014

Hi Joel,

On Thu, Nov 6, 2014 at 2:48 AM, Joel Borggrén-Franck
<joel.franck at oracle.com> wrote:
> Hi,
> I’m having a hard time following this thread, which webrev has been updated, for which release, fixing which issue?

I am submitting the changeset for JDK-8062771, adding the finals and
the (failed reproduction) test.
Hopefully there will be followon changes to add even more thread safety.

> Martin, as far as I can see you are the only one of us who has replied to this thread who is a jdk7u committer (or reviewer).

I am entirely in favor of having more reviewers.

We are not planning to push these into jdk7u or jdk8u ourselves, but
we are willing to help anyone who wants to take on that task.  Joel,
are you volunteering?
We believe all versions of stock openjdk still have (rarely seen)
thread safety issues in core reflection. We have applied changes
locally at Google to fix those.

> I think the assumption is that generic repositories of different kinds are ok with multiple initialization, but maybe we need to revisit this?

Whether or not having multiple initialization is a problem today, it
would definitely be safer to ensure single initialization via volatile
CAS of all fields that make up core reflection.

More information about the core-libs-dev mailing list