Current definition is:
private final MethodHandles.Lookup lookup;
private final EnumDesc<?>[] enumDescs;
@Stable
private Object[] resolvedEnum;
public ResolvedEnumLabels(MethodHandles.Lookup lookup, EnumDesc<?>[] enumDescs) {
this.lookup = lookup;
this.enumDescs = enumDescs;
this.resolvedEnum = new Object[enumDescs.length];
}
...and `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.
private final MethodHandles.Lookup lookup;
private final EnumDesc<?>[] enumDescs;
@Stable
private Object[] resolvedEnum;
public ResolvedEnumLabels(MethodHandles.Lookup lookup, EnumDesc<?>[] enumDescs) {
this.lookup = lookup;
this.enumDescs = enumDescs;
this.resolvedEnum = new Object[enumDescs.length];
}
...and `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.
- relates to
-
JDK-8319220 Pattern matching switch with a lot of cases is unduly slow
- Resolved
-
JDK-8333791 Fix memory barriers for @Stable fields
- Resolved