diff --git a/src/java.base/share/classes/java/util/HexFormat.java b/src/java.base/share/classes/java/util/HexFormat.java index cd6cf8af17d..4c0019f20f4 100644 --- a/src/java.base/share/classes/java/util/HexFormat.java +++ b/src/java.base/share/classes/java/util/HexFormat.java @@ -26,6 +26,9 @@ package java.util; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + import jdk.internal.access.JavaLangAccess; import jdk.internal.access.SharedSecrets; import jdk.internal.util.HexDigits; @@ -137,6 +140,7 @@ */ +@NullMarked public final class HexFormat { // Access to create strings from a byte array. @@ -1056,7 +1060,7 @@ public static long fromHexDigitsToLong(CharSequence string, int fromIndex, int t * otherwise {@code false} */ @Override - public boolean equals(Object o) { + public boolean equals(@Nullable Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass())