Skip to content

[test] jspecify with jqwik 1.8.2#13840

Closed
lqiu96 wants to merge 31 commits into
mainfrom
feat/jspecify-gax-auth-jqwik-test
Closed

[test] jspecify with jqwik 1.8.2#13840
lqiu96 wants to merge 31 commits into
mainfrom
feat/jspecify-gax-auth-jqwik-test

Conversation

@lqiu96

@lqiu96 lqiu96 commented Jul 20, 2026

Copy link
Copy Markdown
Member

No description provided.

nnicolee and others added 30 commits July 16, 2026 18:01
Disable annotations in Mockito mocks for GAX classes across 17 test
files in `google-cloud-bigtable` to avoid ArrayStoreException on Java 8.
These tests were missed in the previous round of fixes.

TAG=agy
CONV=de3ef09d-a26c-4190-b578-4c993f807bdc

@gemini-code-assist 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.

Code Review

This pull request integrates JSpecify nullness annotations (@NullMarked and @nullable) across the gax, gax-grpc, and gax-httpjson modules, updating build dependencies and migrating existing nullability annotations. The review feedback identifies several instances where the @nullable annotation is incorrectly positioned relative to modifiers (such as private, volatile, and static) and declaration annotations like @GuardedBy, which could prevent static analysis tools from properly recognizing them.

// This is initialized once for the lifetime of the application. This enables re-using
// channels to S2A.
private static volatile ChannelCredentials s2aChannelCredentials;
private static @Nullable volatile ChannelCredentials s2aChannelCredentials;

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.

medium

In Java, type-use annotations (such as JSpecify's @Nullable) must appear immediately before the type they annotate, after any modifiers like volatile or static. Placing @Nullable before volatile makes it syntactically a declaration annotation rather than a type-use annotation, which can cause static analysis tools to ignore it or report warnings.

Suggested change
private static @Nullable volatile ChannelCredentials s2aChannelCredentials;
private static volatile @Nullable ChannelCredentials s2aChannelCredentials;

Comment on lines +114 to 116
@Nullable
@GuardedBy("lock")
private HttpRequestRunnable<RequestT, ResponseT> requestRunnable;

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.

medium

In Java, type-use annotations (such as JSpecify's @Nullable) must appear immediately before the type they annotate, after any modifiers like private. Placing @Nullable before modifiers or declaration annotations like @GuardedBy makes it syntactically a declaration annotation rather than a type-use annotation. It should be moved after private.

Suggested change
@Nullable
@GuardedBy("lock")
private HttpRequestRunnable<RequestT, ResponseT> requestRunnable;
@GuardedBy("lock")
private @Nullable HttpRequestRunnable<RequestT, ResponseT> requestRunnable;

Comment on lines +131 to 133
@Nullable
@GuardedBy("lock")
private volatile ScheduledFuture<?> timeoutFuture;

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.

medium

In Java, type-use annotations (such as JSpecify's @Nullable) must appear immediately before the type they annotate, after any modifiers like private volatile. Placing @Nullable before modifiers or declaration annotations like @GuardedBy makes it syntactically a declaration annotation rather than a type-use annotation. It should be moved after private volatile.

Suggested change
@Nullable
@GuardedBy("lock")
private volatile ScheduledFuture<?> timeoutFuture;
@GuardedBy("lock")
private volatile @Nullable ScheduledFuture<?> timeoutFuture;

@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed for 'gapic-generator-java-root'

Failed conditions
B Maintainability Rating on New Code (required ≥ A)
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

💡 Need a hand with PR review? Try Gitar by Sonar!

@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed for 'gapic-generator-java-root'

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)
C Reliability Rating on New Code (required ≥ A)
B Maintainability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

💡 Need a hand with PR review? Try Gitar by Sonar!

@lqiu96 lqiu96 closed this Jul 21, 2026
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.

2 participants