Details

    • Type: Enhancement
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: 13
    • Fix Version/s: tbd_major
    • Component/s: specification
    • Labels:

      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.
      -----

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                abuckley Alex Buckley
                Reporter:
                abuckley Alex Buckley
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated: