Skip to content

refactor: extract Firestore emulator credentials to separate emulator package - #4607

Open
lqiu96 wants to merge 1 commit into
3.xfrom
fix-firestore-emulator-credentials
Open

refactor: extract Firestore emulator credentials to separate emulator package#4607
lqiu96 wants to merge 1 commit into
3.xfrom
fix-firestore-emulator-credentials

Conversation

@lqiu96

@lqiu96 lqiu96 commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Summary

Refactors the Firestore emulator credentials implementation in GcpFirestoreEmulatorAutoConfiguration:

  • Moves the custom Credentials implementation from an anonymous inner class in com.google.cloud.spring.autoconfigure.firestore into com.google.cloud.spring.autoconfigure.emulator.FirestoreEmulatorCredentials.
  • Removes the regex excludeFilters previously added to FirestoreRepositoriesAutoConfigureRegistrar.

Rationale

In Java 8 runtimes, Spring Data's repository component scanning inspects all classes in the auto-configuration package. An anonymous inner class extending com.google.auth.Credentials (which now carries JSpecify 1.0.0 annotations targeting Java 9 ElementType.MODULE) triggered an ArrayStoreException on Java 8. Moving this internal credentials class to a dedicated emulator package prevents Spring Data from scanning it as a repository candidate without requiring any regex filters or test package modifications.

Compatibility

Zero breaking impact. The previous class was a private anonymous inner class; its return type, public API, and header injection behavior (Authorization and google-cloud-resource-prefix) remain identical.

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.

1 participant