From 355250942c3211e3123969e87336dd6521118a51 Mon Sep 17 00:00:00 2001 From: Chris Povirk Date: Fri, 4 Oct 2024 12:41:14 -0400 Subject: [PATCH] Annotate `java.util.random`. --- .../share/classes/java/util/random/RandomGenerator.java | 3 +++ .../share/classes/java/util/random/RandomGeneratorFactory.java | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/java.base/share/classes/java/util/random/RandomGenerator.java b/src/java.base/share/classes/java/util/random/RandomGenerator.java index e019e073a2d..126e454f93f 100644 --- a/src/java.base/share/classes/java/util/random/RandomGenerator.java +++ b/src/java.base/share/classes/java/util/random/RandomGenerator.java @@ -25,6 +25,8 @@ package java.util.random; +import org.jspecify.annotations.NullMarked; + import java.math.BigInteger; import java.security.SecureRandom; import java.util.Objects; @@ -106,6 +108,7 @@ * @since 17 * */ +@NullMarked public interface RandomGenerator { /** * Returns an instance of {@link RandomGenerator} that utilizes the diff --git a/src/java.base/share/classes/java/util/random/RandomGeneratorFactory.java b/src/java.base/share/classes/java/util/random/RandomGeneratorFactory.java index 030f7f70a0a..1778151b777 100644 --- a/src/java.base/share/classes/java/util/random/RandomGeneratorFactory.java +++ b/src/java.base/share/classes/java/util/random/RandomGeneratorFactory.java @@ -25,6 +25,8 @@ package java.util.random; +import org.jspecify.annotations.NullMarked; + import jdk.internal.random.L128X1024MixRandom; import jdk.internal.random.L128X128MixRandom; import jdk.internal.random.L128X256MixRandom; @@ -112,6 +114,7 @@ * @see java.util.random * */ +@NullMarked public final class RandomGeneratorFactory { private static final String DEFAULT_ALGORITHM = "L32X64MixRandom";