Skip to content

fix(core): declare nullable terminal pagination values - #3514

Open
blihio wants to merge 1 commit into
aws-amplify:mainfrom
blihio:codex/fix-nullable-pagination-getters
Open

blihio wants to merge 1 commit into
aws-amplify:mainfrom
blihio:codex/fix-nullable-pagination-getters

Conversation

@blihio

@blihio blihio commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Fixes #3513

PaginatedResult.getRequestForNextResult() and StorageListResult.getNextToken() return null for terminal pages. Add @Nullable to both getters and document that condition so Kotlin callers see nullable types and handle the end of pagination explicitly.

This preserves runtime pagination behavior and JVM method declarations. Recompiled Kotlin callers that assume non-null return values must handle null explicitly.

Validation on Amplify Android 2.43.0:

  • Actual Java API classes and Kotlin 2.2.21 consumers: original getters allow non-null assignments that throw on terminal data; annotated getters reject those assignments at compilation. Safe-call consumers compile and run with both versions.
  • :core:testDebugUnitTest: 163 tests pass, zero failures, errors or skips.
  • :core:checkstyle and :core:lintDebug pass.
  • javap -public declarations are unchanged.

@blihio
blihio requested a review from a team as a code owner November 2, 2026 13:02

This branch has not been deployed

No deployments
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.

Declare nullable terminal pagination values for Kotlin callers

2 participants