Spring / Spring7 basics Interview questions
What is JSpecify in Spring Framework 7?
JSpecify is a community-standard set of nullability annotations (like @Nullable and @NonNull) that Spring Framework 7 has adopted in place of its own previous nullability annotations. The goal is a single, tool-agnostic way to declare which parameters, fields, and return types can be null.
import org.jspecify.annotations.Nullable; public interface UserLookup { @Nullable User findByEmail(String email); }
Because JSpecify is shared across the Java ecosystem, IDEs and static analysis tools understand it consistently, and Kotlin interoperates with it more precisely than it did with Spring's older annotations. Migrating brings some nullability behavior changes, since Spring 7 only checks annotations declared locally rather than inherited ones.
More Related questions...