From bbde970af5734b7985e3315305bd87bacef2ccfe Mon Sep 17 00:00:00 2001 From: Chris Povirk Date: Mon, 7 Oct 2024 11:19:58 -0400 Subject: [PATCH] Annotate `Record`. (#72) Upstream did some work in this file earlier this year but not for nullness: https://github.com/typetools/jdk/commit/fcaecfe9548b26ef22ba8d8fd1cfefba1a25c4f1 --- src/java.base/share/classes/java/lang/Record.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/java.base/share/classes/java/lang/Record.java b/src/java.base/share/classes/java/lang/Record.java index 808bc7cc9cd..dd281406494 100644 --- a/src/java.base/share/classes/java/lang/Record.java +++ b/src/java.base/share/classes/java/lang/Record.java @@ -24,6 +24,9 @@ */ package java.lang; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + /** * This is the common base class of all Java language record classes. * @@ -87,6 +90,7 @@ * @jls 8.10 Record Classes * @since 16 */ +@NullMarked public abstract class Record { /** * Constructor for record classes to call. @@ -140,7 +144,7 @@ protected Record() {} * argument; {@code false} otherwise. */ @Override - public abstract boolean equals(Object obj); + public abstract boolean equals(@Nullable Object obj); /** * Returns a hash code value for the record.