Question about jdk.internal.HotSpotIntrinsicCandidate
Alan.Bateman at oracle.com
Tue Dec 1 20:41:32 UTC 2015
On 01/12/2015 15:47, Stephane Epardaud wrote:
> I'm using reflection to walk classes and methods, and walking
> java.lang.Object.hashCode() I get an annotation of type
> jdk.internal.HotSpotIntrinsicCandidate, which does not appear to be
> exported by java.base (it exports jdk but not jdk.internal). Is that
> intentional? I would have thought that since the annotation is on an
> exported type, javac would not allow it to be annotated with
> non-exported annotations…
@HotSpotIntrinsicCandidate is accessible in java.base where the usages
are. It's visible (you can see it) but isn't accessible outside of the
java.base. So I expect you should be able to invoke annotationType() to
get the annotation type, you just won't be able to do much with it.
The export of package "jdk" is temporary, it's due to @jdk.Exported.
JEP 261 proposes to remove this, it just hasn't been done yet.
More information about the jigsaw-dev