Skip to content

Add compile-time null safety with @NullMarked and NullAway #1251

@jbl428

Description

@jbl428

Describe the feature you request

  1. Adding package-level null safety configuration - Add package-info.java files with @NullMarked annotation from JSpecify to establish non-null as the default for all elements in each package
  2. Integrating NullAway static analysis - Add NullAway as a compile-time checker to automatically detect potential null pointer exceptions and enforce proper null handling throughout the codebase

ref:

(Optional): Suggest A Solution

Proposed implementation approach:

  • Add package-info.java files to all existing packages with @NullMarked annotation
  • NullAway integration

Example package-info.java:

@NullMarked
package com.example.project.core;

import org.jspecify.annotations.NullMarked;

If the feature request is approved, would you be willing to submit a PR?

Yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions