JDK-8229211 : 9.6.4.10: PreviewFeature
  • Type: Enhancement
  • Component: specification
  • Sub-Component: language
  • Affected Version: 13
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2019-08-06
  • Updated: 2019-12-23
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbd_majorUnresolved
Related Reports
Relates :  
Relates :  
Description
A sketch of a new JLS section to mandate an error around APIs marked with @PreviewFeature: (JEP 12 would also need an update to rely on @PreviewFeature rather than terminal deprecation)

-----
Preview features in the Java programming language (��1.5) may depend for some of their semantics on program elements (types, fields, methods, constructors) in the Java SE API. Programmers may use such program elements directly, but should exercise caution because the elements may not be stable between Java SE releases. Elements may change or disappear without first being deprecated, according to whether the associated preview feature is evolved or dropped. The annotation type `PreviewFeature` allows compilers to know of such elements, and to govern their usage accordingly.

A _preview program element_ is a type, field, method, or constructor in the Java SE API whose declaration is annotated with @PreviewFeature.

It is a compile-time error if a preview program element is used (overridden, invoked, or referenced by name) when preview features are not enabled via the host system.

The annotation @PreviewFeature has no effect if applied to program elements outside the Java SE API. Such annotated elements are not preview program elements, and a Java compiler will not raise an error for their use.
-----