Skip to content

test: jspecify and exclude jqwik#13847

Draft
nnicolee wants to merge 32 commits into
mainfrom
test/jspecify-and-exclude-jqwik
Draft

test: jspecify and exclude jqwik#13847
nnicolee wants to merge 32 commits into
mainfrom
test/jspecify-and-exclude-jqwik

Conversation

@nnicolee

Copy link
Copy Markdown
Contributor

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 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.

Comment on lines 294 to +296
@Override
@ObsoleteApi("Use getTimeoutDuration() instead")
public org.threeten.bp.Duration getTimeout() {
public org.threeten.bp.@Nullable Duration getTimeout() {

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

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.

Suggested change
@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
  1. Update stale Javadoc comments to reflect new method behavior for improved clarity, rather than removing them.

Comment on lines +44 to +47
.setRequestFormatter(
mock(HttpRequestFormatter.class, Mockito.withSettings().withoutAnnotations()))
.setRequestFormatter(
mock(HttpRequestFormatter.class, Mockito.withSettings().withoutAnnotations()))

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

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.

Suggested change
.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);

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

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.

Suggested change
public abstract Builder setQuotaProjectId(@Nullable String QuotaProjectId);
public abstract Builder setQuotaProjectId(@Nullable String quotaProjectId);

@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 added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 21, 2026
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label 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.

3 participants