On 01/12/2015 15:47, Stephane Epardaud wrote:
Hi,

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.

-Alan.

Reply via email to