test: jspecify and exclude jqwik#13847
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 widely introduces JSpecify nullness annotations (@NullMarked and @Nullable) across the gax-grpc, gax-httpjson, and gax modules, alongside Mockito mock cleanups in test files. The review feedback highlights a few areas for improvement: restoring an accidentally deleted Javadoc comment in GrpcCallContext.java, removing a redundant duplicate call to setRequestFormatter in HttpJsonLoggingInterceptorTest.java, and correcting the parameter casing of QuotaProjectId to camelCase in ClientContext.java to adhere to standard Java naming conventions.
| @Override | ||
| @ObsoleteApi("Use getTimeoutDuration() instead") | ||
| public org.threeten.bp.Duration getTimeout() { | ||
| public org.threeten.bp.@Nullable Duration getTimeout() { |
There was a problem hiding this comment.
The Javadoc comment /** This method is obsolete. Use {@link #getTimeoutDuration()} instead. */ was accidentally removed. It should be restored to maintain proper documentation for the obsolete method.
| @Override | |
| @ObsoleteApi("Use getTimeoutDuration() instead") | |
| public org.threeten.bp.Duration getTimeout() { | |
| public org.threeten.bp.@Nullable Duration getTimeout() { | |
| /** This method is obsolete. Use {@link #getTimeoutDuration()} instead. */ | |
| @Override | |
| @ObsoleteApi("Use getTimeoutDuration() instead") | |
| public org.threeten.bp.@Nullable Duration getTimeout() { |
References
- Update stale Javadoc comments to reflect new method behavior for improved clarity, rather than removing them.
| .setRequestFormatter( | ||
| mock(HttpRequestFormatter.class, Mockito.withSettings().withoutAnnotations())) | ||
| .setRequestFormatter( | ||
| mock(HttpRequestFormatter.class, Mockito.withSettings().withoutAnnotations())) |
There was a problem hiding this comment.
The setRequestFormatter method is called twice consecutively on the builder, which is redundant as the second call simply overwrites the first one. One of the calls should be removed.
| .setRequestFormatter( | |
| mock(HttpRequestFormatter.class, Mockito.withSettings().withoutAnnotations())) | |
| .setRequestFormatter( | |
| mock(HttpRequestFormatter.class, Mockito.withSettings().withoutAnnotations())) | |
| .setRequestFormatter( | |
| mock(HttpRequestFormatter.class, Mockito.withSettings().withoutAnnotations())) |
| public abstract Builder setEndpoint(String endpoint); | ||
|
|
||
| public abstract Builder setQuotaProjectId(String QuotaProjectId); | ||
| public abstract Builder setQuotaProjectId(@Nullable String QuotaProjectId); |
There was a problem hiding this comment.
The parameter name QuotaProjectId starts with an uppercase letter, which violates standard Java naming conventions (parameters should be camelCase starting with a lowercase letter). It should be renamed to quotaProjectId.
| public abstract Builder setQuotaProjectId(@Nullable String QuotaProjectId); | |
| public abstract Builder setQuotaProjectId(@Nullable String quotaProjectId); |
|
|


No description provided.