testing for a class having been loaded
Alan Bateman
Alan.Bateman at oracle.com
Wed Nov 30 16:45:40 UTC 2016
On 30/11/2016 15:51, Alan Snyder wrote:
> :
> As Michael said, the hack is using reflection with setAccessible() to call the protected method ClassLoader::findLoadedClass().
>
> Is there some conceptual or security reason to not provide this functionality in a public API?
It's protected because it's for use in class loader implementations. It
is final so it could potentially be changed to public but would require
a lot of consideration before going that road. To be honest, the
scenario is a bit odd, there must be a saner solution that doesn't
involve checking if classes are loaded.
-Alan
More information about the jigsaw-dev
mailing list