FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix(auth): refine JSpecify nullability annotations for core ADC credentials by lqiu96 · Pull Request #14162 · googleapis/google-cloud-java · GitHub

fix(auth): refine JSpecify nullability annotations for core ADC credentials - #14162

Draft
lqiu96 wants to merge 1 commit into
mainfrom
fix_auth_adc_credentials_nullability
Draft

fix(auth): refine JSpecify nullability annotations for core ADC credentials#14162
lqiu96 wants to merge 1 commit into
mainfrom
fix_auth_adc_credentials_nullability

Conversation

lqiu96 commented Aug 21, 2026
edited
Loading

Copy link
Copy Markdown
Member

Refines JSpecify nullability annotations across core ADC credential classes:

  • Type-Use Placement & Nullability: Annotate optional fields, getters, and builder setters/fields with @Nullable across:
    • ComputeEngineCredentials
    • AppEngineCredentials (both appengine and oauth2_http modules)
    • DefaultCredentialsProvider
    • ImpersonatedCredentials
    • GdchCredentials
    • CloudShellCredentials
    • DownscopedCredentials
    • IdTokenCredentials
    • IdTokenProvider
  • Preconditions: Standardize on com.google.common.base.Preconditions over com.google.api.client.util.Preconditions.
  • Builder Copy Constructors: Ensure builder copy constructors properly preserve all fields and chain super(credentials).

lqiu96 requested review from a team as code owners August 21, 2026 20:30
lqiu96 marked this pull request as draft August 21, 2026 20:32

gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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 617607c to 8b30685 Compare August 21, 2026 22:10
lqiu96 changed the title fix(auth): refine JSpecify nullability annotations for ADC credential types fix(auth): refine JSpecify nullability annotations for core ADC credentials Aug 21, 2026
…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 8b30685 to 0c59b08 Compare August 21, 2026 22:21
lqiu96 added a commit that referenced this pull request Aug 25, 2026
…nt credentials (#14164)

Stacked on #14162.

Refines JSpecify nullability annotations across
ExternalAccountCredentials and subclasses:
- **Type-Use Placement & Nullability**: Annotate optional fields,
getters, and builder setters/fields with `@Nullable` across:
  - `ExternalAccountCredentials`
  - `IdentityPoolCredentials`
  - `AwsCredentials`
  - `PluggableAuthCredentials`
  - `ExternalAccountAuthorizedUserCredentials`
- **Preconditions**: Standardize on
`com.google.common.base.Preconditions` over
`com.google.api.client.util.Preconditions`.
- **Builder Copy Constructors**: Ensure builder copy constructors
properly preserve all fields.
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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant


Back | FazBrowse Home | New Git URL