Preview APIs for preview features -- JDK 14+
Gunnar Morling
gunnar at hibernate.org
Thu Aug 8 06:48:43 UTC 2019
Thanks, Alex; gotcha, and it's in line with how I understood what the
proposal is about.
Essentially, my question is whether one couldn't come up with a slightly
more versatile solution, which solves both the issue the Java SE Platform
encounters when adding new APIs connected to preview language/VM features,
*and* the similar, yet slightly different situation often-times encountered
by 3rd party library developers.
--Gunnar
Am Mi., 7. Aug. 2019 um 17:04 Uhr schrieb Alex Buckley <
alex.buckley at oracle.com>:
> On 8/7/2019 4:00 AM, Gunnar Morling wrote:
> >> Joe Darcy has proposed that associated APIs are annotated explicitly
> >> (e.g. @java.lang.annotation.PreviewFeature) so that their use can be
> >> detected at compile time.
> >
> > I think that's a very useful addition.
> >
> > IIUC, this is only geared towards usage within the JDK APIs themselves;
> > maybe it could be considered to widen the scope of the proposal and
> enable
> > usage of this functionality by 3rd party APIs? Specifically, I'm thinking
> > of supporting similar, already existing annotations, e.g. @Beta in Guava
> or
> > or @Incubating in Hibernate.
>
> There's a misconception in your model of "preview APIs", regrettably
> caused my use of the term as shorthand in the subject line. Let's be
> clear what we're discussing: an API defined by the Java SE Platform that
> is intimately connected with a preview language/VM feature. (JEP 12
> refers to this as an "essential" API because the JLS cannot avoid
> referring to it in normative text; see the JEP for examples.) If the
> preview language/VM feature changes or disappears, then the API will
> most likely change or disappear too. We are NOT looking to have APIs in
> the Java SE Platform that are "standalone" (independent of preview
> features) yet impermanent and in search of developer feedback. We have
> already settled on incubating APIs (JEP 11) as the mechanism for
> "standalone" impermanent APIs. Incubating APIs are deliberately kept out
> of the Java SE Platform (recall their `jdk.incubator` module and package
> prefix) to ensure developers realize that their use is risky.
>
> Alex
>
More information about the jdk-dev
mailing list