Integrated: 8335274: SwitchBootstraps.ResolvedEnumLabels.resolvedEnum should be final

Aleksey Shipilev shade at openjdk.org
Fri Jun 28 16:29:28 UTC 2024


On Thu, 27 Jun 2024 19:30:34 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

> I was auditing the current uses of `@Stable` before relaxing its barriers ([JDK-8333791](https://bugs.openjdk.org/browse/JDK-8333791)), and this is an easy spot. 
> 
> `resolvedEnum` is not `final`. So technically publishing the object via data race can show `resolvedEnum` as `null`, which would break `test()` that does not expect it. Currently not a practical problem since its safety is covered by adjacent `final` fields, but should be more precise.

This pull request has now been integrated.

Changeset: 45c4eaa5
Author:    Aleksey Shipilev <shade at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/45c4eaa5600016d3da5ca769b2519df53835e4f7
Stats:     1 line in 1 file changed: 0 ins; 0 del; 1 mod

8335274: SwitchBootstraps.ResolvedEnumLabels.resolvedEnum should be final

Reviewed-by: liach, jlahoda

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

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


More information about the core-libs-dev mailing list