<!--
title: Package null-safety annotations
domain: app-frameworks
topic: Null Handling
language: Xml
source: spring-projects/spring-framework
updated: 2023-03-08
url: https://awesomereviewers.com/reviewers/spring-framework-package-null-safety-annotations/
-->

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:
```java
/**
 * Package documentation here.
 */
@NonNullApi
@NonNullFields
package com.example.mypackage;

import org.springframework.lang.NonNullApi;
import org.springframework.lang.NonNullFields;
```
