File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
java-compiler-testing/src/main/java/io/github/ascopes/jct/utils Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 1919import java .util .function .Supplier ;
2020import org .apiguardian .api .API ;
2121import org .apiguardian .api .API .Status ;
22+ import org .jspecify .annotations .Nullable ;
2223
2324/**
2425 * Helper type that wraps an initializer and invokes it lazily as required.
3233 * <p>This descriptor is thread-safe. No guarantees are made about the thread-safety of the
3334 * internally stored data, nor the initializer supplier.
3435 *
36+ * <p>This descriptor currently does not support virtual threads. Any synchronization will
37+ * occur on the physical thread level.
38+ *
3539 * @param <T> the type of lazy value to return when accessed.
3640 * @author Ashley Scopes
3741 * @since 0.0.1
3842 */
3943@ API (since = "0.0.1" , status = Status .INTERNAL )
40- public class Lazy <T > {
44+ public final class Lazy <T > {
4145
4246 private final Supplier <T > initializer ;
4347 private final Object lock ;
44- private volatile T data ;
48+ private volatile @ Nullable T data ;
4549
4650 /**
4751 * Initialize the object.
You can’t perform that action at this time.
0 commit comments