RFR: 8354877: DirectClassBuilder default flags should include ACC_SUPER

Chen Liang liach at openjdk.org
Wed Apr 23 00:01:15 UTC 2025


In the future value objects JEP, class files must have one of ACC_IDENTITY (now ACC_SUPER), ACC_ABSTRACT, and ACC_FINAL bits set, otherwise they are rejected. The current default flag has none of these bits set, meaning that it will not be suitable in the future. Currently, most class file generation in the JDK explicitly set ACC_SUPER for compatibility; we should also set this bit in the default flags, despite being no-op, in anticipation of future compatibility.

The API specifications of ClassBuilder and AccessFlags already state that an unspecified default flag for class builders are chosen, so changing this flag should be fine without extra specification changes.

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

Commit messages:
 - 8354877: DirectClassBuilder default flags should include ACC_SUPER

Changes: https://git.openjdk.org/jdk/pull/24808/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=24808&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8354877
  Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod
  Patch: https://git.openjdk.org/jdk/pull/24808.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/24808/head:pull/24808

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


More information about the core-libs-dev mailing list