Skip to content

fix(core): declare lazy schema registration failures for Java callers - #3503

Open
blihio wants to merge 1 commit into
aws-amplify:mainfrom
blihio:codex/fix-schema-registry-checked-exception
Open

blihio wants to merge 1 commit into
aws-amplify:mainfrom
blihio:codex/fix-schema-registry-checked-exception

Conversation

@blihio

@blihio blihio commented Oct 26, 2026

Copy link
Copy Markdown
Contributor
  • PR title and description conform to the contribution guidelines.

Issue #, if available:

Fixes #3502

Description of changes:

SchemaRegistry's three name/map overloads propagate IrRecoverableException from a Kotlin helper without declaring it. Java callers cannot compile a catch for that checked exception even though the call can throw it.

Add @throws to both Kotlin registration helpers, propagate throws through the three Java overloads, and document the failure. Add nine Kotlin regression tests using real ModelSchema objects and JavaCompiler probes; update two existing Java test call chains to handle the declaration.

How did you test these changes?

  • New regression tests: original source fails the three Java typed-catch probes; patched source passes all nine cases.

  • Full unit suites: core 172, aws-api-appsync 50, aws-datastore 250; 472 pass, zero failures or skipped tests.

  • core ktlintCheck, checkstyle and lintDebug pass.

  • aws-datastore checkstyle and core assembleRelease pass.

  • Upstream BCV 0.18.2 validates the built Release JAR against core/api/core.api through a temporary external task; the upstream build files and API baseline are unchanged.

  • JVM signatures across 629 production classes are unchanged. A Java client compiled against the original artifact passes six runtime checks against the patched artifact.

  • Full-repository clean build was also attempted: the online run was stopped after five minutes waiting in dependency TLS handshakes; an offline retry could not resolve uncached dependencies in other modules, including maplibre-adapter. The full-repository build is therefore not claimed as passing.

Java source compatibility

Adding the checked throws declaration changes Java source requirements. An existing client's source reports three previously invisible unhandled exceptions when recompiled against the patched artifact. The corresponding compiled client continues to run.

This source compatibility impact should be considered when choosing the release and exception policy. The patch preserves existing registration behavior. Validation includes 472 passing unit tests, Java compilation probes, and binary compatibility checks. Android device and Flutter end-to-end testing were outside the scope of this validation.

Documentation update required?

  • No separate documentation change; Java exception contracts are documented in Javadoc.
  • Yes

General Checklist

  • Added Unit Tests
  • Added Integration Tests
  • Security oriented best practices and standards are followed.
  • Commit message has the appropriate scope.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@blihio
blihio requested a review from a team as a code owner October 26, 2026 08:49

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.

SchemaRegistry overloads throw a checked exception Java callers cannot catch by type

1 participant