Integrated: JDK-8250768: javac should be adapted to changes in JEP 12

Jan Lahoda jlahoda at
Mon Jan 11 10:15:06 UTC 2021

On Fri, 16 Oct 2020 15:20:03 GMT, Jan Lahoda <jlahoda at> wrote:

> This is an update to javac and javadoc, to introduce support for Preview APIs, and generally improve javac and javadoc behavior to more closely adhere to JEP 12.
> The notable changes are:
>  * adding support for Preview APIs (javac until now supported primarily only preview language features, and APIs associated with preview language features). This includes:
>      * the @PreviewFeature annotation has boolean attribute "reflective", which should be true for reflective Preview APIs, false otherwise. This replaces the existing "essentialAPI" attribute with roughly inverted meaning.
>      * the preview warnings for preview APIs are auto-suppressed as described in the JEP 12. E.g. the module that declares the preview API is free to use it without warnings
>  * improving error/warning messages. Please see [1] for a list of cases/examples.
>  * class files are only marked as preview if they are using a preview feature. [1] also shows if a class file is marked as preview or not.
>  * the PreviewFeature annotation has been moved to jdk.internal.javac package (originally was in the jdk.internal package).
>  * Preview API in JDK's javadoc no longer needs to specify @preview tag in the source files. javadoc will auto-generate a note for @PreviewFeature elements, see e.g. [2] and [3] (non-reflective and reflective API, respectively). A summary of preview elements is also provided [4]. Existing uses of @preview have been updated/removed.
>  * non-JDK javadoc is also enhanced to auto-generate preview notes for uses of Preview elements, and for declaring elements using preview language features [5].
>  Please also see the CSR [6] for more information.
>  [1]
>  [2]
>  [3]
>  [4]
>  [5]
>  [6]

This pull request has now been integrated.

Changeset: 23548821
Author:    Jan Lahoda <jlahoda at>
Stats:     3802 lines in 133 files changed: 2724 ins; 695 del; 383 mod

8250768: javac should be adapted to changes in JEP 12

Reviewed-by: mcimadamore, erikj, jjg, ihse



More information about the compiler-dev mailing list