Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
strategy:
fail-fast: false
matrix:
java: [11, 17, 21, 25]
java: [11, 17, 21, 25, 26]
steps:
- name: Get current week within the year
id: date
Expand Down Expand Up @@ -226,7 +226,7 @@ jobs:
fail-fast: false
matrix:
package: ${{ fromJSON(needs.changes.outputs.packages) }}
java: [11, 17, 21, 25]
java: [11, 17, 21, 25, 26]
steps:
- name: Get current week within the year
id: date
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/google-auth-library-java-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
strategy:
fail-fast: false
matrix:
java: [11, 17, 21, 25]
java: [11, 17, 21, 25, 26]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/java-bigquery-jdbc-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
strategy:
fail-fast: false
matrix:
java: [11, 17, 21, 25]
java: [11, 17, 21, 25, 26]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/java-bigtable-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
strategy:
fail-fast: false
matrix:
java: [11, 17, 21, 25]
java: [11, 17, 21, 25, 26]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/java-firestore-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
strategy:
fail-fast: false
matrix:
java: [11, 17, 21, 25]
java: [11, 17, 21, 25, 26]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/java-pubsub-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
strategy:
fail-fast: false
matrix:
java: [11, 17, 21, 25]
java: [11, 17, 21, 25, 26]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/java-spanner-jdbc-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
strategy:
fail-fast: false
matrix:
java: [11, 17, 21, 25]
java: [11, 17, 21, 25, 26]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/java-storage-nio-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
strategy:
fail-fast: false
matrix:
java: [11, 17, 21, 25]
java: [11, 17, 21, 25, 26]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
Expand Down
13 changes: 9 additions & 4 deletions .github/workflows/sdk-platform-java-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
name: sdk-platform-java units
strategy:
matrix:
java: [ 11, 17, 21, 25 ]
java: [ 11, 17, 21, 25, 26 ]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
Expand Down Expand Up @@ -164,16 +164,21 @@ jobs:
run: |
bazelisk --batch test //sdk-platform-java/test/integration/... --test_output=errors

bazel-25:
# JDK 24+ permanently disables Security Manager. Bazel's default test runner tries to install it.
# We must explicitly disable this behavior using shouldInstallTestSecurityManager=false.
bazel-no-security-manager-jdk24-plus:
needs: filter
if: ${{ needs.filter.outputs.library == 'true' }}
runs-on: ubuntu-22.04
name: sdk-platform-java integration (25)
name: sdk-platform-java integration (JDK 24+)
strategy:
matrix:
java: [ 25, 26 ]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: 25
java-version: ${{ matrix.java }}
distribution: temurin
cache: maven
- run: bazelisk version
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/showcase.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ jobs:
runs-on: ubuntu-22.04
strategy:
matrix:
java: [ 11, 17, 21, 25 ]
java: [ 11, 17, 21, 25, 26 ]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
Expand Down
45 changes: 45 additions & 0 deletions google-cloud-pom-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
<properties>
<skipUnitTests>false</skipUnitTests>
<checkstyle.header.file>java.header</checkstyle.header.file>
<errorprone.version>2.48.0</errorprone.version>
<!-- By default, no special internal javac flag is needed on JDK 22+.
For JDK 21 specifically, profile errorprone-jdk21 activates the required flag. -->
<errorprone.javac.args>-g</errorprone.javac.args>
</properties>

<developers>
Expand Down Expand Up @@ -129,6 +133,47 @@
</plugins>
</build>
</profile>
<profile>
<!-- Error Prone 2.43.0+ drops execution support for JDK 11 and 17 (requires a JDK 21+ runtime).
Because our SDK client libraries actively support building and running on Java 8+,
we must downgrade to legacy Error Prone 2.38.0 when compiling under JDK < 17. -->
<id>errorprone-jdk11</id>
<activation>
<jdk>[1.8,17)</jdk>
</activation>
<properties>
<errorprone.version>2.38.0</errorprone.version>
<errorprone.javac.args>-g</errorprone.javac.args>
</properties>
</profile>
<profile>
<!-- Error Prone 2.43.0+ drops execution support for JDK 11 and 17 (requires a JDK 21+ runtime).
When compiling under JDK 17, we downgrade to Error Prone 2.42.0 (the final release supporting JDK 17). -->
<id>errorprone-jdk17</id>
<activation>
<jdk>[17,21)</jdk>
</activation>
<properties>
<errorprone.version>2.42.0</errorprone.version>
<errorprone.javac.args>-g</errorprone.javac.args>
</properties>
</profile>
<profile>
<!-- On JDK 21 specifically (21.0.8+), we require '-XDaddTypeAnnotationsToSymbol=true'
to force Javac to eagerly attach JSR-308 type-use annotations to AST compiler symbols across
compilation boundaries, avoiding internal NullPointerExceptions in Error Prone plugin evaluations.
Ref: https://github.com/google/error-prone/issues/5426

On JDK 22+ (including 25 and 26), OpenJDK enables this cross-boundary symbol attribution fix
natively by default in standard javac executions. Therefore, the flag is omitted. -->
<id>errorprone-jdk21</id>
<activation>
<jdk>21</jdk>
</activation>
<properties>
<errorprone.javac.args>-XDaddTypeAnnotationsToSymbol=true</errorprone.javac.args>
</properties>
</profile>
</profiles>

<repositories>
Expand Down
3 changes: 2 additions & 1 deletion java-bigtable/google-cloud-bigtable/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,7 @@
<arg>-XDcompilePolicy=simple</arg>
<arg>--should-stop=ifError=FLOW</arg>
<arg>-Xplugin:ErrorProne -XepDisableWarningsInGeneratedCode -Xep:MissingSummary:OFF -Xep:InlineMeSuggester:OFF -Xep:AutoValueImmutableFields:OFF -Xep:ObjectEqualsForPrimitives:OFF -Xep:JavaDurationGetSecondsToToSeconds:OFF</arg>
<arg>${errorprone.javac.args}</arg>

<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED</arg>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED</arg>
Expand All @@ -457,7 +458,7 @@
<path>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_core</artifactId>
<version>${error-prone.version}</version>
<version>${errorprone.version}</version>
</path>
</annotationProcessorPaths>
</configuration>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public void testFromProto() {
assertThat(result.getState()).isEqualTo(Cluster.State.READY);
assertThat(result.getServeNodes()).isEqualTo(30);
assertThat(result.getStorageType()).isEqualTo(StorageType.SSD);
assertThat(result.getKmsKeyName()).isEqualTo(null);
assertThat(result.getKmsKeyName()).isNull();
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import com.google.cloud.opentelemetry.detection.GCPPlatformDetector.SupportedPlatform;
import com.google.common.base.Function;
import com.google.common.base.Supplier;
import com.google.common.base.Suppliers;
import com.google.common.collect.ImmutableMap;
import java.util.Map;
import org.junit.jupiter.api.Test;
Expand All @@ -33,7 +32,7 @@

@ExtendWith(MockitoExtension.class)
class EnvInfoTest {
private static final Supplier<String> NULL_HOST = Suppliers.ofInstance(null);
private static final Supplier<String> NULL_HOST = () -> null;

@SuppressWarnings("UnnecessaryLambda")
private static final Function<String, String> NULL_ENV = (ignored) -> null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ public void testReadRowsOpCount() throws InterruptedException {
}

@Test
@SuppressWarnings("FutureReturnValueIgnored")
@SuppressWarnings({"FutureReturnValueIgnored", "NullArgumentForNonNullParameter"})
public void testReadRowsFirstRow() throws InterruptedException {
final long beforeSleep = 50;
final long afterSleep = 50;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import com.google.common.truth.Subject;
import com.google.rpc.RetryInfo;
import java.time.Duration;
import java.util.Optional;
import javax.annotation.Nullable;

public final class VRpcResultSubject extends Subject {
Expand All @@ -47,12 +46,14 @@ public void hasRetryInfo() {
}

public ComparableSubject<Duration> retryInfoDelay() {
return check("retryInfo.delay")
.that(
Optional.ofNullable(actual.getRetryInfo())
.map(RetryInfo::getRetryDelay)
.map(d -> Duration.ofSeconds(d.getSeconds()).plus(Duration.ofNanos(d.getNanos())))
.orElse(null));
RetryInfo retryInfo = actual.getRetryInfo();
Duration delay = null;
if (retryInfo != null) {
delay =
Duration.ofSeconds(retryInfo.getRetryDelay().getSeconds())
.plus(Duration.ofNanos(retryInfo.getRetryDelay().getNanos()));
}
return check("retryInfo.delay").that(delay);
}

public ComparableSubject<Duration> backendLatency() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ public void tearDown() throws Exception {
}

@Test
@SuppressWarnings("NullArgumentForNonNullParameter")
public void outstandingRequestsFinishAfterClose() throws Exception {
ApiFuture<List<Row>> resultFuture =
stub.readRowsCallable().all().futureCall(Query.create(TableId.of("table1")));
Expand All @@ -99,6 +100,7 @@ public void outstandingRequestsFinishAfterClose() throws Exception {

class FakeBigtable extends BigtableGrpc.BigtableImplBase {
@Override
@SuppressWarnings("NullArgumentForNonNullParameter")
public void readRows(
ReadRowsRequest request, StreamObserver<ReadRowsResponse> responseObserver) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,7 @@ public void testRMWRequestResponseConversion() throws ExecutionException, Interr
}

@Test
@SuppressWarnings("NullArgumentForNonNullParameter")
public void testMutateRowRequestResponseConversion()
throws ExecutionException, InterruptedException {
RowMutation req = RowMutation.create(TableId.of("my-table"), "my-key").deleteRow();
Expand All @@ -385,10 +386,11 @@ public void testMutateRowRequestResponseConversion()
MutateRowRequest protoReq = fakeDataService.mutateRowRequests.poll(1, TimeUnit.SECONDS);
assertThat(protoReq)
.isEqualTo(req.toProto(RequestContext.create(PROJECT_ID, INSTANCE_ID, APP_PROFILE_ID)));
assertThat(f.get()).isEqualTo(null);
Comment thread
lqiu96 marked this conversation as resolved.
assertThat(f.get()).isNull();
}

@Test
@SuppressWarnings("NullArgumentForNonNullParameter")
public void testMutateRowRequestParams() throws ExecutionException, InterruptedException {
RowMutation req = RowMutation.create(TABLE_ID, "my-key").deleteRow();

Expand All @@ -407,7 +409,7 @@ public void testMutateRowRequestParams() throws ExecutionException, InterruptedE
// StatsHeadersUnaryCallable
assertThat(reqMetadata.keys()).contains("bigtable-client-attempt-epoch-usec");

assertThat(f.get()).isEqualTo(null);
Comment thread
lqiu96 marked this conversation as resolved.
assertThat(f.get()).isNull();
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ public void testManyToOne() throws InterruptedException {
// First downstream request makes the upstream over produce
outerObserver.getController().request(1);
Truth.assertThat(outerObserver.popNextResponse()).isEqualTo("a");
Truth.assertThat(outerObserver.popNextResponse()).isEqualTo(null);
Truth.assertThat(outerObserver.popNextResponse()).isNull();
Truth.assertThat(outerObserver.isDone()).isFalse();

// Next downstream request should fetch from buffer
Expand Down
2 changes: 0 additions & 2 deletions java-bigtable/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,6 @@
<site.installationModule>google-cloud-bigtable-parent</site.installationModule>
<project.javadoc.protobufBaseURL>https://googleapis.dev/java/google-api-grpc/latest</project.javadoc.protobufBaseURL>

<!-- Utility -->
<error-prone.version>2.38.0</error-prone.version>
</properties>

<dependencyManagement>
Expand Down
3 changes: 2 additions & 1 deletion java-datastore/datastore-v1-proto-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@
<arg>-XDcompilePolicy=simple</arg>
<arg>--should-stop=ifError=FLOW</arg>
<arg>-Xplugin:ErrorProne -XepExcludedPaths:.*/generated-sources/.*</arg>
<arg>${errorprone.javac.args}</arg>

<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED</arg>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED</arg>
Expand All @@ -163,7 +164,7 @@
<path>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_core</artifactId>
<version>${error-prone.version}</version>
<version>${errorprone.version}</version>
</path>
</annotationProcessorPaths>
</configuration>
Expand Down
3 changes: 2 additions & 1 deletion java-datastore/google-cloud-datastore-utils/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@
<arg>-XDcompilePolicy=simple</arg>
<arg>--should-stop=ifError=FLOW</arg>
<arg>-Xplugin:ErrorProne -XepExcludedPaths:.*/generated-sources/.*</arg>
<arg>${errorprone.javac.args}</arg>

<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED</arg>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED</arg>
Expand All @@ -140,7 +141,7 @@
<path>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_core</artifactId>
<version>${error-prone.version}</version>
<version>${errorprone.version}</version>
</path>
</annotationProcessorPaths>
</configuration>
Expand Down
3 changes: 2 additions & 1 deletion java-datastore/google-cloud-datastore/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@
<arg>-XDcompilePolicy=simple</arg>
<arg>--should-stop=ifError=FLOW</arg>
<arg>-Xplugin:ErrorProne -XepExcludedPaths:.*/generated-sources/.*</arg>
<arg>${errorprone.javac.args}</arg>

<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED</arg>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED</arg>
Expand All @@ -308,7 +309,7 @@
<path>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_core</artifactId>
<version>${error-prone.version}</version>
<version>${errorprone.version}</version>
</path>
</annotationProcessorPaths>
</configuration>
Expand Down
Loading
Loading