JEP draft: Prepare to Restrict The Use of JNI

Volker Simonis volker.simonis at gmail.com
Thu Aug 24 14:11:49 UTC 2023


On Thu, Aug 24, 2023 at 7:03 AM Maurizio Cimadamore
<maurizio.cimadamore at oracle.com> wrote:
>
>
> On 24/08/2023 14:47, Volker Simonis wrote:
> > I think the changes we are talking about here are much to fundamental
> > for the Java platform to hide them in the API documentation of a
> > package.
>
> I think I've already explained how the plan is to move restricted
> methods out of the FFM package javadoc.
>
> As to the modifier idea - I think whatever arguments you make for
> restricted methods also holds for preview API methods. We have been
> previewing APIs for a number of years, and we have developed several
> concepts that we can reuse here. In what way are restricted methods more
> attention-deserving than preview API methods?

The fundamental difference is that preview features are new features
which only impact newly written code. Restricted methods cut backward
compatibility and affect all Java code which has been written until
now (not the current ones in the Foreign module, but  the future ones
in the JNI space).

>
> (And, no, I don't think we should add _two_ modifiers :-) )
>
> Maurizio
>


More information about the jdk-dev mailing list