fix(auth): refine JSpecify nullability annotations for core ADC credentials - #14162
Draft
lqiu96 wants to merge 1 commit into
Draft
fix(auth): refine JSpecify nullability annotations for core ADC credentials#14162lqiu96 wants to merge 1 commit into
lqiu96 wants to merge 1 commit into
Conversation
lqiu96
marked this pull request as draft
August 21, 2026 20:32
Contributor
There was a problem hiding this comment.
Code Review
This pull request systematically adds @Nullable and @Override annotations across various Google credential classes and their builders to enhance null safety and code clarity. It also refactors some exception message formatting and simplifies a null check in IdentityPoolCredentials. Feedback on these changes highlights a double-space typo introduced in an exception message within ComputeEngineCredentials.java, which should be corrected to a single space for consistency.
lqiu96
force-pushed
the
fix_auth_adc_credentials_nullability
branch
from
August 21, 2026 22:10
617607c to
8b30685
Compare
…ntials Refine JSpecify nullability annotations across core ADC credential types: - Annotate optional fields, getters, and builder setters/fields with @nullable across AccessToken, ComputeEngineCredentials, AppEngineCredentials, DefaultCredentialsProvider, ImpersonatedCredentials, GdchCredentials, CloudShellCredentials, DownscopedCredentials, IdTokenCredentials, and IdTokenProvider. - Annotate EnvironmentProvider and SystemEnvironmentProvider getEnv methods with @nullable. - Remove redundant final modifiers on private methods in DefaultCredentialsProvider. - Ensure correct JSpecify type-use annotation placements on fields, return types, and parameters. - Migrate Preconditions imports to com.google.common.base.Preconditions. - Ensure builder copy constructors properly preserve all fields and chain super(credentials).
lqiu96
force-pushed
the
fix_auth_adc_credentials_nullability
branch
from
August 21, 2026 22:21
8b30685 to
0c59b08
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refines JSpecify nullability annotations across core ADC credential classes:
@Nullableacross:ComputeEngineCredentialsAppEngineCredentials(bothappengineandoauth2_httpmodules)DefaultCredentialsProviderImpersonatedCredentialsGdchCredentialsCloudShellCredentialsDownscopedCredentialsIdTokenCredentialsIdTokenProvidercom.google.common.base.Preconditionsovercom.google.api.client.util.Preconditions.super(credentials).