RFR: 8282823: javac should constrain more uses of preview APIs

Jan Lahoda jlahoda at openjdk.java.net
Thu Mar 10 12:36:09 UTC 2022


Consider a class or interface with a method marked as preview. Subclassing the class or implementing the interface by itself should not cause a preview error/warning (as that would be problematic for Loom), but overriding the method should produce a preview error/warning.

This patch adds the error/warning in case a preview method is overridden.

-------------

Commit messages:
 - Improving test.
 - 8282823: javac should constrain more uses of preview APIs

Changes: https://git.openjdk.java.net/jdk/pull/7774/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=7774&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8282823
  Stats: 203 lines in 2 files changed: 203 ins; 0 del; 0 mod
  Patch: https://git.openjdk.java.net/jdk/pull/7774.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/7774/head:pull/7774

PR: https://git.openjdk.java.net/jdk/pull/7774


More information about the compiler-dev mailing list