RFR: 8347646: module-info classfile missing the preview flag

Jan Lahoda jlahoda at openjdk.org
Tue Jan 14 09:33:21 UTC 2025


Consider module-info.java like this:

module m {
    requires transitive java.base;
}


When compiled with `--enable-preview --source 24/25`, the resulting classfile is missing the preview flag.

This PR proposes to use `Preview.checkSourceLevel` to check the source level, which marks the source to use the preview feature.

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

Commit messages:
 - 8347646: module-info classfile missing the preview flag

Changes: https://git.openjdk.org/jdk/pull/23097/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=23097&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8347646
  Stats: 99 lines in 4 files changed: 81 ins; 9 del; 9 mod
  Patch: https://git.openjdk.org/jdk/pull/23097.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/23097/head:pull/23097

PR: https://git.openjdk.org/jdk/pull/23097


More information about the compiler-dev mailing list