RFR: 8344703: Compiler Implementation for Flexible Constructor Bodies

Maurizio Cimadamore mcimadamore at openjdk.org
Tue Apr 8 11:36:37 UTC 2025


On Tue, 8 Apr 2025 11:24:46 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

> This PR finalizes the Flexible Constructor Bodies feature with no semantics changes.
> The main changes in this PR have to do with the various tests, which needed tweaking (e.g. to drop `@enablePreview` and fix corresponding golden files).
> 
> We might, later on, incorporate a fix for [this issue](https://bugs.openjdk.org/browse/JDK-8349754) into this PR, depending on where the specification for this feature lands.

test/langtools/tools/javac/diags/examples/PreviewFeatureUse.java line 2:

> 1: /*
> 2:  * Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved.

I did a bit of reshuffling here -- we had a single diagnostic test called `PreviewFeatureUse` which was only testing the `warn.preview.feature.use.plural` diagnostic. As a consequence, when I changed flexible constructor bodies to no longer be a preview feature, I started getting failures in `CheckExamples` because there was no test covering `warn.preview.feature.use` (e.g. w/o the trailing `.plural`). So I've added a test for both diagnostics (and renamed the old one to `PreviewFeatureUsePlural`).

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24505#discussion_r2032992109


More information about the compiler-dev mailing list