Skip to content

Do not upgrade NullAway to 0.13.x until upstream bug is fixed #4339

@andimarek

Description

@andimarek

Context

Dependabot PR #4317 bumps NullAway from 0.12.10 to 0.13.1. This upgrade causes 3 compilation errors due to a known NullAway bug.

The problem

NullAway 0.13.0+ has a bug (uber/NullAway#1453) where generic methods with @Contract("null -> fail") no longer work correctly. When calling:

public static <T> T assertNotNull(@Nullable T object) { ... }

NullAway 0.13.x propagates javac's inferred @Nullable on the generic type variable T to the return type — even though the @Contract annotation guarantees non-null return. This means code like:

List<Value> copiedValues = assertNotNull(deepCopy(values));
// NullAway 0.13.x treats copiedValues as @Nullable

fails with: passing @Nullable parameter 'copiedValues' where @NonNull is required.

Affected files

  • ArrayValue.java:95assertNotNull(deepCopy(values))
  • ObjectValue.java:84assertNotNull(deepCopy(objectFields))
  • MergedField.java:431assertNotNull(this.fields, ...)

Upstream fix status

The fix is uber/NullAway#1471 — merged on 2026-02-16 but not yet released. It will be available in NullAway 0.13.2 or later.

Action

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions