RFR (S + L test) : 8016839 : JSR292: AME instead of IAE when calling a method

John Rose john.r.rose at oracle.com
Tue Nov 26 01:29:22 UTC 2013

On Nov 25, 2013, at 1:49 AM, Paul Sandoz <paul.sandoz at oracle.com> wrote:

> Just curious: why did you chose to add the method, throwIllegalAccessError, to s.m.Unsafe and add Unsafe to the list pre-loaded classes rather than modifying an existing pre-loaded class?

Unsafe is used everywhere, including from some of the preloaded classes.  Thus it will be preloaded even if it is not on the JVM's preload list, so there's no harm in naming it this way from the JVM.

And thus we get to the Naming Question...

As a class, Unsafe is a stable, non-public name space, and is (unusually) tightly coupled to the JVM.  It has no other qualifications specific to this new use.

We don't already have "sun.misc.InternalMethods", but it's not something we want to invent, just for this method.  David has noted that introducing a new class would complicate backporting.

— John

More information about the core-libs-dev mailing list