[test] jspecify with jqwik 1.8.2#13840
Conversation
…-cloud-java into feat/jspecify-gax-auth
…-cloud-java into feat/jspecify-gax-auth
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
…-cloud-java into feat/jspecify-gax-auth
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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.
| private static @Nullable volatile ChannelCredentials s2aChannelCredentials; | |
| private static volatile @Nullable ChannelCredentials s2aChannelCredentials; |
| @Nullable | ||
| @GuardedBy("lock") | ||
| private HttpRequestRunnable<RequestT, ResponseT> requestRunnable; |
There was a problem hiding this comment.
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.
| @Nullable | |
| @GuardedBy("lock") | |
| private HttpRequestRunnable<RequestT, ResponseT> requestRunnable; | |
| @GuardedBy("lock") | |
| private @Nullable HttpRequestRunnable<RequestT, ResponseT> requestRunnable; |
| @Nullable | ||
| @GuardedBy("lock") | ||
| private volatile ScheduledFuture<?> timeoutFuture; |
There was a problem hiding this comment.
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.
| @Nullable | |
| @GuardedBy("lock") | |
| private volatile ScheduledFuture<?> timeoutFuture; | |
| @GuardedBy("lock") | |
| private volatile @Nullable ScheduledFuture<?> timeoutFuture; |
|
|


No description provided.