JEP draft: Prepare to Restrict The Use of JNI
Maurizio Cimadamore
maurizio.cimadamore at oracle.com
Thu Aug 24 13:45:45 UTC 2023
Using a public, but not exported annotation is what I'm suggesting.
But note that external tools won't be able to retrieve this annotation
reflectively (e.g. using Method::getAnnotation), because the annotation
is not really "public".
As for IDEs and external tools, it would be similar to how they handle
preview features/API today (note also that, at the level of classfile
processing - e.g. using the classfile API - obviously you can see that
an annotation is there).
Maurizio
On 24/08/2023 14:14, Volker Simonis wrote:
> I'm not a module expert but can't we create a public, documented
> annotation in a package which is only exported to the core JDK modules
> with the help of a qualified export?
>
>> That said, an internal annotation like `@PreviewFeature` could be enough
>> to provide javac support along the lines you describe.
>>
> Yes, that would be enough for javac but not for IDEs and external tools.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/jdk-dev/attachments/20230824/400d7793/attachment-0001.htm>
More information about the jdk-dev
mailing list