Preview APIs in the Java Platform

Alex Buckley alex.buckley at oracle.com
Mon Mar 9 18:45:31 UTC 2020


Cédric,

On 3/9/2020 12:24 AM, Cédric Champeau wrote:
> That said, to come back to the topic, I agree that libraries
> published with experimental features should not be published on Maven
> Central. ... Long story short, I think experimental features or APIs
> should be limited to your toy projects, but certainly not used by
> mainstream libraries. As a consumer, I don't want my project to
> suddenly break because an experimental API changed in a new JDK
> release, or that the JVM changed the implementation, or that the 
> bytecode format changed between two releases of the experimental
> feature. I think the comparison with newer JDK releases (it's the
> same as if a library is compiled for a newer version of the JDK) is
> not correct, because we're talking about things which are deemed
> unstable, and promoted as such. If they were stable, they wouldn't be
> experimental.

I agree with the thrust of your message -- an artifact that needs 
preview features to be enabled is for personal use only, and should not 
be distributed -- but is there anything I can do to stop you saying 
"experimental features" when you talk about preview features? It's going 
to confuse users because JEP 12 says they are different things:

-----
The key properties of a preview language or VM [OR API] feature are:

- Not experimental. A language or VM [OR API] feature that is considered
experimental, risky, incomplete, or unstable must not be previewed in a
JDK feature release. An experimental feature must be iterated and
stabilized in its own project, which in turn produces binaries that are
clearly distinguished from binaries of the JDK Project. For the purpose
of comparison, if an experimental feature is considered 25% "done", then
a preview feature should be at least 95% "done". To make a further
comparison, the level of completeness and stability expected for a
preview language or VM [OR API] feature is considerably higher than the
level expected for an incubating API.
-----

Alex


More information about the jdk-dev mailing list