JDK-8231433 : 1.5: Robust handling of code using essential APIs associated with preview features
  • Type: Enhancement
  • Component: specification
  • Sub-Component: language
  • Affected Version: 13
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2019-09-24
  • Updated: 2020-07-15
  • Resolved: 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.
JDK 14
14Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
Per http://openjdk.java.net/jeps/12#Relationship-to-Java-SE-APIs:

- The use of an essential API element associated with a preview feature must cause either a compile-time error or a suppressible warning, depending on whether preview features are disabled or enabled respectively. JLS 1.5 must specify the presence of the error/warning, and enumerate which types/methods in Java SE 14 cause it. JLS 9.6.4.5 must record that the warning is suppressible via `@SuppressWarnings("preview")`.

- The use of a reflective API element associated with a preview feature is worthy of a warning regardless of whether preview features are disabled or enabled -- but technically this is a compiler-specific warning, not a JLS-mandated warning. Reflective APIs, whether in java.*, javax.*, or com.sun.source.*, are outside the JLS's scope.