Back to all reviewers

Package null-safety annotations

spring-projects/spring-framework
Based on 3 comments
Xml

All package-info.java files must include both @NonNullApi and @NonNullFields annotations to establish null-safety at the package level. These annotations must each be on a single line for proper detection by static analysis tools. This practice makes null-handling behavior explicit, reduces NullPointerExceptions, and enforces consistent null-safety...

Null Handling Xml

Reviewer Prompt

All package-info.java files must include both @NonNullApi and @NonNullFields annotations to establish null-safety at the package level. These annotations must each be on a single line for proper detection by static analysis tools. This practice makes null-handling behavior explicit, reduces NullPointerExceptions, and enforces consistent null-safety conventions across the codebase.

Example:

/**
 * Package documentation here.
 */
@NonNullApi
@NonNullFields
package com.example.mypackage;

import org.springframework.lang.NonNullApi;
import org.springframework.lang.NonNullFields;
3
Comments Analyzed
Xml
Primary Language
Null Handling
Category

Source Discussions