Skip to content

JSpecify incompatibility #14147

Description

@markusheiden

Issue Details

With the Google Ads Java SDK 45.0.0 release, some transient libraries were migrated to use JSpecify annotations by simply just adding @NullMarked to the classes.

Dependencies

  • com.google.api-ads:google-ads:45.0.0 →
  • com.google.auth:google-auth-library-oauth2-http

Reproducer

This no longer works:

  • Code that implements com.google.auth.oauth2.TokenStore.
  • Code that passes a null baseUri to com.google.auth.oauth2.UserAuthorizer#getAuthorizationUrl or com.google.auth.oauth2.UserAuthorizer#getAndStoreCredentialsFromCode.

Behavior

The update of google-auth-library-oauth2-http to 1.50.0 as a transitive dependency of the Google Ads Java SDK caused the problem: googleads/google-ads-java#904

Expected

  • The return value of com.google.auth.oauth2.TokenStore#load value should be @Nullable, because null is the expected result for "no token found".
  • The baseUri parameter in com.google.auth.oauth2.UserAuthorizer#getAuthorizationUrl and com.google.auth.oauth2.UserAuthorizer#getAndStoreCredentialsFromCode should be @Nullable, because it is just required if using relative callback URIs.
  • JSpecify migration made reasonable by checking what needs @Nullable and what does not.

Metadata

Metadata

Assignees

Labels

priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions