Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
5a85552
testing automation tool on gax
nnicolee Jul 16, 2026
9f25a79
running automation tool on gax-java
nnicolee Jul 16, 2026
f4e63af
feat(gax): refactor javax to jspecify type-use null annotations
nnicolee Jul 17, 2026
471b684
testing automation tool on gax
nnicolee Jul 16, 2026
1887dc5
running automation tool on gax-java
nnicolee Jul 16, 2026
7a0c69e
feat(gax): refactor javax to jspecify type-use null annotations
nnicolee Jul 17, 2026
805997e
Merge branch 'main' into feat/jspecify-gax-auth
nnicolee Jul 17, 2026
81b33cf
Merge branch 'main' into feat/jspecify-gax-auth
nnicolee Jul 17, 2026
1ca35b7
Merge branch 'feat/jspecify-gax-auth' of github.com:googleapis/google…
nnicolee Jul 17, 2026
ce4b81b
declare jspecify dependencies
nnicolee Jul 17, 2026
84806ee
test: disable copying annotations on mocks for Java 8 for sdk-platfor…
nnicolee Jul 17, 2026
178b92a
fix previous errors on disabling copying annotations
nnicolee Jul 17, 2026
629620a
fix further for disable copying annotations
nnicolee Jul 17, 2026
5b6153c
Merge branch 'feat/jspecify-gax-auth' of github.com:googleapis/google…
nnicolee Jul 17, 2026
a11f36e
test: disable copying annotations on ApiTracerContext mocks for Java …
nnicolee Jul 17, 2026
5214eb8
test(bigtable): fix remaining JSpecify CI issues on Java 8
lqiu96 Jul 17, 2026
20bbada
more disable mock annotation copying
nnicolee Jul 17, 2026
8b73c7d
fixed the remaining mocks
nnicolee Jul 17, 2026
e333068
Merge branch 'fix-jspecify-ci-bigtable-mockito' into pr-13799
lqiu96 Jul 17, 2026
7c99224
fixed the rest of the mocks
nnicolee Jul 17, 2026
91c37e8
Merge branch 'main' into feat/jspecify-gax-auth
nnicolee Jul 19, 2026
fba10fa
add JSpecify dependency to Bazel BUILD files
nnicolee Jul 19, 2026
d8ebf04
Merge branch 'feat/jspecify-gax-auth' of github.com:googleapis/google…
nnicolee Jul 19, 2026
c094849
Merge branch 'main' into feat/jspecify-gax-auth
nnicolee Jul 20, 2026
5e37306
revert: added back import mock for bigtable test
nnicolee Jul 20, 2026
bf8da72
Merge branch 'main' into feat/jspecify-gax-auth
nnicolee Jul 20, 2026
5b0dbec
revert: added back import for Answers for bigtable test
nnicolee Jul 20, 2026
81ce6d1
Merge branch 'main' into feat/jspecify-gax-auth
nnicolee Jul 20, 2026
619e82d
ran linting on java-bigtable test
nnicolee Jul 20, 2026
62220e0
fix: exclude jqwik tests on Java 8
nnicolee Jul 21, 2026
ea14da7
Merge branch 'main' of github.com:googleapis/google-cloud-java into f…
nnicolee Jul 21, 2026
73369ee
Merge branch 'test/exclude-jqwik-java8' into test/jspecify-and-exclud…
nnicolee Jul 21, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
55 changes: 49 additions & 6 deletions java-storage/google-cloud-storage/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -338,12 +338,6 @@
<artifactId>junit-vintage-engine</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.jqwik</groupId>
<artifactId>jqwik</artifactId>
<version>1.9.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.github.classgraph</groupId>
<artifactId>classgraph</artifactId>
Expand Down Expand Up @@ -474,6 +468,55 @@
</build>

<profiles>
<profile>
<id>jqwik-tests</id>
<activation>
<jdk>[11,)</jdk>
</activation>
<dependencies>
<dependency>
<groupId>net.jqwik</groupId>
<artifactId>jqwik</artifactId>
<version>1.9.3</version>
<scope>test</scope>
</dependency>
</dependencies>
</profile>
<profile>
<id>exclude-jqwik-on-java8</id>
<activation>
<jdk>1.8</jdk>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<executions>
<execution>
<id>default-testCompile</id>
<configuration>
<testExcludes>
<exclude>**/*PropertyTest.java</exclude>
<exclude>**/JqwikTest.java</exclude>
<exclude>**/jqwik/**</exclude>
<exclude>**/StorageV2ProtoUtilsTest.java</exclude>
<exclude>**/JsonUtilsTest.java</exclude>
<exclude>**/ChunkSegmenterTest.java</exclude>
<exclude>**/DefaultBufferedWritableByteChannelTest.java</exclude>
<exclude>**/MinFlushBufferedWritableByteChannelTest.java</exclude>
<exclude>**/DefaultBufferedReadableByteChannelTest.java</exclude>
<exclude>**/Crc32cValueTest.java</exclude>
<exclude>**/ITSyncingFileChannelTest.java</exclude>
<exclude>**/RewindableByteBufferContentTest.java</exclude>
</testExcludes>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>idea-jqwik</id>
<dependencies>
Expand Down
1 change: 1 addition & 0 deletions sdk-platform-java/gax-java/gax-grpc/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ _COMPILE_DEPS = [
"@com_google_guava_guava//jar",
"@com_google_code_findbugs_jsr305//jar",
"@com_google_code_gson_gson//jar",
"@org_jspecify_jspecify//jar",
"@org_threeten_threetenbp//jar",
"@gapic_generator_java//google-auth-library-java/oauth2_http",
"@gapic_generator_java//google-auth-library-java/credentials",
Expand Down
4 changes: 4 additions & 0 deletions sdk-platform-java/gax-java/gax-grpc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
</parent>

<dependencies>
<dependency>
<groupId>org.jspecify</groupId>
<artifactId>jspecify</artifactId>
</dependency>
<dependency>
<groupId>com.google.api</groupId>
<artifactId>gax</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,14 @@

import com.google.api.gax.rpc.ApiStreamObserver;
import io.grpc.stub.StreamObserver;
import org.jspecify.annotations.NullMarked;

/**
* A delegate class that transfers calls to the ApiStreamObserver object.
*
* <p>Package-private for internal use.
*/
@NullMarked
class ApiStreamObserverDelegate<V> implements StreamObserver<V> {

private final ApiStreamObserver<V> delegate;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,10 @@
import io.grpc.Metadata.Key;
import java.util.Collections;
import java.util.Map;
import org.jspecify.annotations.NullMarked;

/** A utility class that provides helper functions to work with custom call options. */
@NullMarked
class CallOptionsUtil {
// this is a call option name, not a header name, it is not transferred over the wire
private static final CallOptions.Key<Map<Key<String>, String>> DYNAMIC_HEADERS_CALL_OPTION_KEY =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,14 @@
import com.google.api.core.InternalApi;
import io.grpc.ManagedChannel;
import java.io.IOException;
import org.jspecify.annotations.NullMarked;

/**
* This interface represents a factory for creating one ManagedChannel
*
* <p>This is public only for technical reasons, for advanced usage.
*/
@NullMarked
@InternalApi("For internal use by google-cloud-java clients only")
public interface ChannelFactory {
ManagedChannel createSingleChannel() throws IOException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@
import java.util.concurrent.atomic.AtomicReference;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.annotation.Nullable;
import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable;

/**
* A {@link ManagedChannel} that will send requests round-robin via a set of channels.
Expand All @@ -68,6 +69,7 @@
*
* <p>Package-private for internal use.
*/
@NullMarked
class ChannelPool extends ManagedChannel {
static final String CHANNEL_POOL_CONSECUTIVE_RESIZING_WARNING =
"The gRPC ChannelPool used in the client has been flagged to be repeatedly resizing (5+ times). See https://github.com/googleapis/google-cloud-java/blob/main/docs/grpc_channel_pool_guide.md for more information about this behavior.";
Expand All @@ -78,8 +80,8 @@ class ChannelPool extends ManagedChannel {
private final ChannelFactory channelFactory;
private final FixedExecutorProvider backgroundExecutorProvider;

private ScheduledFuture<?> refreshFuture = null;
private ScheduledFuture<?> resizeFuture = null;
private @Nullable ScheduledFuture<?> refreshFuture = null;
private @Nullable ScheduledFuture<?> resizeFuture = null;

private final Object entryWriteLock = new Object();
@VisibleForTesting final AtomicReference<ImmutableList<Entry>> entries = new AtomicReference<>();
Expand Down Expand Up @@ -621,7 +623,7 @@ public <RequestT, ResponseT> ClientCall<RequestT, ResponseT> newCall(

/** ClientCall wrapper that makes sure to decrement the outstanding RPC count on completion. */
static class ReleasingClientCall<ReqT, RespT> extends SimpleForwardingClientCall<ReqT, RespT> {
@Nullable private CancellationException cancellationException;
private @Nullable CancellationException cancellationException;
final Entry entry;
private final AtomicBoolean wasClosed = new AtomicBoolean();
private final AtomicBoolean wasReleased = new AtomicBoolean();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import com.google.auto.value.AutoValue;
import com.google.common.base.Preconditions;
import java.time.Duration;
import org.jspecify.annotations.NullMarked;

/**
* Settings to control {@link ChannelPool} behavior.
Expand All @@ -52,6 +53,7 @@
*
* <p>The settings in this class will be applied every minute.
*/
@NullMarked
@BetaApi("surface for channel pool sizing is not yet stable")
@AutoValue
public abstract class ChannelPoolSettings {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,14 @@

import com.google.api.core.InternalApi;
import io.grpc.ManagedChannel;
import org.jspecify.annotations.NullMarked;

/**
* An interface to prepare a ManagedChannel for normal requests by priming the channel
*
* <p>This is public only for technical reasons, for advanced usage.
*/
@NullMarked
@InternalApi("For internal use by google-cloud-java clients only")
public interface ChannelPrimer {
void primeChannel(ManagedChannel managedChannel);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,10 @@
import com.google.api.gax.rpc.StateCheckingResponseObserver;
import com.google.api.gax.rpc.StreamController;
import java.util.concurrent.CancellationException;
import org.jspecify.annotations.NullMarked;

/** Package-private for internal use. */
@NullMarked
class ExceptionResponseObserver<RequestT, ResponseT>
extends StateCheckingResponseObserver<ResponseT> {
private ResponseObserver<ResponseT> innerObserver;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,10 @@
import com.google.api.gax.core.GaxProperties;
import io.grpc.Channel;
import java.util.regex.Pattern;
import org.jspecify.annotations.NullMarked;

/** Provides properties of the GAX-GRPC library. */
@NullMarked
@InternalApi
public class GaxGrpcProperties {
private static final String GAX_GRPC_VERSION =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,15 @@
import io.grpc.StatusException;
import io.grpc.StatusRuntimeException;
import java.util.Set;
import org.jspecify.annotations.NullMarked;

/**
* Core logic for transforming GRPC exceptions into {@link ApiException}s. This logic is shared
* amongst all the call types.
*
* <p>Package-private for internal use.
*/
@NullMarked
class GrpcApiExceptionFactory {

@VisibleForTesting static final String ERROR_DETAIL_KEY = "grpc-status-details-bin";
Expand Down Expand Up @@ -77,7 +79,7 @@
boolean canRetry = retryableCodes.contains(GrpcStatusCode.grpcCodeToStatusCode(statusCode));
GrpcStatusCode grpcStatusCode = GrpcStatusCode.of(statusCode);

if (metadata == null) {

Check warning on line 82 in sdk-platform-java/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/GrpcApiExceptionFactory.java

View check run for this annotation

SonarQubeCloud / [gapic-generator-java-root] SonarCloud Code Analysis

Change this condition so that it does not always evaluate to "false"

See more on https://sonarcloud.io/project/issues?id=googleapis_google-cloud-java_showcase&issues=AZ-Fm24FnwEU1_wPCXOD&open=AZ-Fm24FnwEU1_wPCXOD&pullRequest=13847
return ApiExceptionFactory.createException(throwable, grpcStatusCode, canRetry);
}

Expand Down
Loading
Loading