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;