Skip to content

Adopt the nullable StateManager.repository return type - #178

Merged
CodeDrivenMitch merged 1 commit into
mainfrom
fix/statemanager-nullable-repository
Sep 17, 2026
Merged

CodeDrivenMitch merged 1 commit into
mainfrom
fix/statemanager-nullable-repository

Conversation

@CodeDrivenMitch

Copy link
Copy Markdown
Collaborator

Axon Framework 5.3.1 added @org.jspecify.annotations.Nullable to the return of StateManager#repository(Class, Class). Kotlin therefore sees Repository<ID, T>?, while our delegating override still declared Repository<ID, T>, which no longer compiles:

AxoniqPlatformStateManager.kt:53:16 Return type mismatch:
expected 'Repository<ID, T>', actual 'Repository<ID, T>?'

The nightly framework-compatibility canary has been failing on this since the framework moved to 5.3.1 on 2026-08-14. It has been masked for the last few weeks by a separate problem — the framework's published snapshot POMs are unresolvable (AxonIQ/axoniq-framework#502) — so the build could not even get as far as compiling.

Changes

  • AxoniqPlatformStateManager#repository returns Repository<ID, T>?, matching the interface.
  • axoniq-framework.version 5.3.0 -> 5.3.2.

The baseline bump is required, not incidental: on 5.3.0 the return is non-null (the package is @NullMarked), so a nullable override is rejected there. One source cannot satisfy both, and 5.3.2 is the current release of the line we already track.

Only the nullability changed — the members of StateManager and Repository are otherwise identical between 5.3.0 and 5.4.0-SNAPSHOT, and there are no other call sites of .repository( in this repository.

Verification

clean verify is green on all four modules, both on the new 5.3.2 baseline and against the current 5.4.0-SNAPSHOT: 120 tests, 0 failures, 0 errors.

AxoniqConsoleRSocketClientToxiproxyIntegrationTest (4 tests) was excluded from those runs. It fails identically on unmodified main with the 5.3.0 baseline on the same machine, so it is a pre-existing local environment issue unrelated to this change.

Note for the framework team

A nullability change that breaks downstream compilation shipped in a patch release (5.3.0 -> 5.3.1). Worth considering whether that belongs in a minor instead.

Axon Framework 5.3.1 annotated StateManager#repository as @nullable, so
the override no longer compiled: Kotlin sees Repository<ID, T>? where we
declared Repository<ID, T>. The nightly compatibility canary has been red
on this since the framework moved to it.

Bumps the baseline from 5.3.0 to 5.3.2 so the override matches, which
also keeps compiling against the current 5.4.0-SNAPSHOT.
@sonarqubecloud

Copy link
Copy Markdown

@CodeDrivenMitch
CodeDrivenMitch requested review from a team, Andrew-deVillier and stefanmirkovic and removed request for a team September 15, 2026 11:03
@CodeDrivenMitch CodeDrivenMitch self-assigned this Sep 15, 2026
@CodeDrivenMitch
CodeDrivenMitch merged commit be95d29 into main Sep 17, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants