RFR: 8334733: Remove obsolete @enablePreview from tests after JDK-83324714

Chen Liang liach at openjdk.org
Wed Nov 27 23:19:23 UTC 2024


Remove the redundant `@enablePreview` and `--enable-preview` flags for enabling ClassFile API in the tests.  The remainder of these flags in all tests seem to serve preview APIs (such as ScopedValue) or language features (primitive pattern, module imports, etc.), or testing the enable preview flag itself.  Now there is fewer than 100 `@enablePreview` in the `test` directory.

To reviewers, there are some redundant changes and notes:

- There's one security test that used `ModuleInfoWriter` that depends on ClassFile API.
- Removed unnecessary exports of `jdk.internal.classfile.impl`. Remaining uses are:
  - `BoundAttribute::payloadLen` for javac attribute tests
  - Annotation reading/writing for javac annotation tests
- Line number changes to:
  - test/langtools/tools/javac/linenumbers/NestedLineNumberTest.java
  - test/langtools/tools/javac/linenumbers/NullCheckLineNumberTest.java
- Move from legacy jdk.internal.classfile to java.lang.classfile in:
  - test/langtools/tools/javac/NoStringToLower.java and 
  - test/langtools/tools/javac/T8003967/DetectMutableStaticFields.java
- Weird annotation processor behavior in test/langtools/tools/javac/annotations/parameter/ParameterAnnotations.java

  - Without preview and using explicit file name, the javac task fails; using the builder live AP object works both with and without preview.

Testing: did a quick tier 1-2 locally, waiting for CI on tier 1-3.  Please inform me if any of these tests belong to higher tiers.

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

Commit messages:
 - 8334733: Remove obsolete @enablePreview from tests after JDK-83324714

Changes: https://git.openjdk.org/jdk/pull/22420/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=22420&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8334733
  Stats: 635 lines in 360 files changed: 2 ins; 556 del; 77 mod
  Patch: https://git.openjdk.org/jdk/pull/22420.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/22420/head:pull/22420

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


More information about the core-libs-dev mailing list