Skip to content

ci: add JDK 26 testing support#13352

Draft
lqiu96 wants to merge 16 commits into
mainfrom
add-jdk-26-support
Draft

ci: add JDK 26 testing support#13352
lqiu96 wants to merge 16 commits into
mainfrom
add-jdk-26-support

Conversation

@lqiu96
Copy link
Copy Markdown
Member

@lqiu96 lqiu96 commented Jun 3, 2026

Add JDK 26 to build matrices in GitHub Actions workflows. Update Bazel integration tests in sdk-platform-java to run on JDK 25 and 26 with Security Manager override.

High Level Changes

  1. Update errorprone version to a version that supports JDK 26 (Centralize all the configs so that the version is set from shared-deps). Added the additional configs necessary for the newer JDK versions
  2. ErrorProne changes in BigTable and Datastore - New flagged changes from newer versions

BigTable and Datastore Changes Due to ErrorProne

Datastore

01:52:32:119 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.13.0:compile (default-compile) on project google-cloud-datastore: Compilation failure: Compilation failure: 
01:52:32:119 [ERROR] /tmpfs/src/github/google-cloud-java/java-datastore/google-cloud-datastore/src/main/java/com/google/cloud/datastore/DatastoreHelper.java:[41,58] error: [NullArgumentForNonNullParameter] Null is not permitted for this parameter.
01:52:32:119 [ERROR]     (see https://errorprone.info/bugpattern/NullArgumentForNonNullParameter)
01:52:32:119 [ERROR] /tmpfs/src/github/google-cloud-java/java-datastore/google-cloud-datastore/src/main/java/com/google/cloud/datastore/DatastoreHelper.java:[45,82] error: [NullArgumentForNonNullParameter] Null is not permitted for this parameter.
01:52:32:119 [ERROR]     (see https://errorprone.info/bugpattern/NullArgumentForNonNullParameter)

BigTable

01:49:56:149 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.13.0:testCompile (default-testCompile) on project google-cloud-bigtable: Compilation failure: Compilation failure: 
01:49:56:149 [ERROR] /tmpfs/src/github/google-cloud-java/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/ClusterTest.java:[50,49] error: [NullArgumentForNonNullParameter] Null is not permitted for this parameter.
01:49:56:149 [ERROR]     (see https://errorprone.info/bugpattern/NullArgumentForNonNullParameter)
01:49:56:149 [ERROR] /tmpfs/src/github/google-cloud-java/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/attributes/EnvInfoTest.java:[36,73] error: [NullArgumentForNonNullParameter] Null is not permitted for this parameter.
01:49:56:149 [ERROR]     (see https://errorprone.info/bugpattern/NullArgumentForNonNullParameter)
01:49:56:149 [ERROR] /tmpfs/src/github/google-cloud-java/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/opencensus/MetricsTracerTest.java:[252,20] error: [NullArgumentForNonNullParameter] Null is not permitted for this parameter.
01:49:56:149 [ERROR]     (see https://errorprone.info/bugpattern/NullArgumentForNonNullParameter)
01:49:56:149 [ERROR] /tmpfs/src/github/google-cloud-java/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/test_helpers/VRpcResultSubject.java:[55,23] error: [NullArgumentForNonNullParameter] Null is not permitted for this parameter.
01:49:56:149 [ERROR]     (see https://errorprone.info/bugpattern/NullArgumentForNonNullParameter)
01:49:56:149 [ERROR] /tmpfs/src/github/google-cloud-java/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubCloseTest.java:[95,28] error: [NullArgumentForNonNullParameter] Null is not permitted for this parameter.
01:49:56:150 [ERROR]     (see https://errorprone.info/bugpattern/NullArgumentForNonNullParameter)
01:49:56:150 [ERROR] /tmpfs/src/github/google-cloud-java/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubCloseTest.java:[106,33] error: [NullArgumentForNonNullParameter] Null is not permitted for this parameter.
01:49:56:150 [ERROR]     (see https://errorprone.info/bugpattern/NullArgumentForNonNullParameter)
01:49:56:150 [ERROR] /tmpfs/src/github/google-cloud-java/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubTest.java:[388,34] error: [NullArgumentForNonNullParameter] Null is not permitted for this parameter.
01:49:56:150 [ERROR]     (see https://errorprone.info/bugpattern/NullArgumentForNonNullParameter)
01:49:56:150 [ERROR] /tmpfs/src/github/google-cloud-java/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubTest.java:[388,20] error: [NullArgumentForNonNullParameter] Null is not permitted for this parameter.
01:49:56:150 [ERROR]     (see https://errorprone.info/bugpattern/NullArgumentForNonNullParameter)
01:49:56:150 [ERROR] /tmpfs/src/github/google-cloud-java/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubTest.java:[410,34] error: [NullArgumentForNonNullParameter] Null is not permitted for this parameter.
01:49:56:150 [ERROR]     (see https://errorprone.info/bugpattern/NullArgumentForNonNullParameter)
01:49:56:150 [ERROR] /tmpfs/src/github/google-cloud-java/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubTest.java:[410,20] error: [NullArgumentForNonNullParameter] Null is not permitted for this parameter.
01:49:56:150 [ERROR]     (see https://errorprone.info/bugpattern/NullArgumentForNonNullParameter)
01:49:56:150 [ERROR] /tmpfs/src/github/google-cloud-java/java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/gaxx/reframing/ReframingResponseObserverTest.java:[188,64] error: [NullArgumentForNonNullParameter] Null is not permitted for this parameter.
01:49:56:150 [ERROR]     (see https://errorprone.info/bugpattern/NullArgumentForNonNullParameter)

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Note

Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported.

@lqiu96 lqiu96 force-pushed the add-jdk-26-support branch from 4e26dcc to b611b53 Compare June 4, 2026 15:01
@lqiu96
Copy link
Copy Markdown
Member Author

lqiu96 commented Jun 4, 2026

/gemini review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

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 updates the Error Prone configuration across the parent and child POMs to support JDK 21+ while maintaining compatibility with older JDKs via profiles. It also addresses various Error Prone warnings by replacing null assertions, removing unused imports, and refactoring code. Feedback on the changes suggests preserving the blocking f.get() calls in EnhancedBigtableStubTest by using assertThat(f.get()).isNull() instead of deleting the assertions entirely, which could lead to race conditions. Additionally, it is recommended to rename the misleadingly named limit iterator variable in DatastoreHelper to results or iterator for better readability.

lqiu96 added 16 commits June 8, 2026 16:03
Add JDK 26 to build matrices in GitHub Actions workflows.
Update Bazel integration tests in sdk-platform-java to run on JDK 25 and 26 with Security Manager override.

BUG=b/481669998
TAG=agy
CONV=7b193e4d-38f8-450c-8475-0b9ae0d04507
Bump Error Prone version to 2.45.0 to support compilation on JDK 26.
This resolves compilation failures due to internal javac API changes in JDK 26.

BUG=b/481669998
TAG=agy
CONV=7b193e4d-38f8-450c-8475-0b9ae0d04507
Define error-prone.version as 2.48.0 in google-cloud-pom-parent,
matching the version in gapic-generator-java-pom-parent.
Remove local overrides from java-bigtable and java-datastore so
they inherit the version from the parent.

BUG=b/481669998
TAG=agy
CONV=7b193e4d-38f8-450c-8475-0b9ae0d04507
Update Error Prone references in java-bigtable and java-datastore to use
the version and arguments defined in google-cloud-pom-parent.
This resolves compilation issues on JDK 26 while maintaining compatibility
with older JDK versions via profiles in the parent POM.

BUG=b/481669998
TAG=agy
CONV=7b193e4d-38f8-450c-8475-0b9ae0d04507
Fix compilation errors triggered by the new Error Prone version.
- Update DatastoreHelper to avoid Iterators.getNext(..., null).
- Update Bigtable tests to use isNull() instead of isEqualTo(null).
- Update Bigtable tests to use lambda instead of Suppliers.ofInstance(null).
- Suppress NullArgumentForNonNullParameter for SettableFuture<Void> set(null) calls.
- Rewrite VRpcResultSubject to avoid passing null to Truth's that() directly.

BUG=b/481669998
TAG=agy
CONV=7b193e4d-38f8-450c-8475-0b9ae0d04507
- Rename profiles in google-cloud-pom-parent for clarity:
  - jdk-old -> errorprone-jdk11
  - jdk-mid -> errorprone-jdk17
- Add comments explaining Error Prone downgrades and compiler flags.
- Reformat EnvInfoTest.java to comply with style guide.

BUG=b/481669998
TAG=agy
CONV=7b193e4d-38f8-450c-8475-0b9ae0d04507
Remove tautological assertThat(f.get()).isNull() assertions on ApiFuture<Void>
instances where f.get() normal completion is already evaluated lines earlier.
This cleanly resolves Error Prone NullArgumentForNonNullParameter warnings
without adding @SuppressWarnings annotations.

BUG=b/481669998
TAG=agy
CONV=7b193e4d-38f8-450c-8475-0b9ae0d04507
Rename Iterator<Entity> temporary variable in DatastoreHelper.get() from
misleading "limit" to "results" based on PR review feedback.

BUG=b/481669998
TAG=agy
CONV=7b193e4d-38f8-450c-8475-0b9ae0d04507
Restore assertThat(f.get()).isNull() assertions in EnhancedBigtableStubTest
based on PR review feedback to explicitly document asynchronous future completion.
Add @SuppressWarnings("NullArgumentForNonNullParameter") annotations to resolve
Error Prone warnings triggered by Truth.assertThat() receiving an ApiFuture<Void>
result.

BUG=b/481669998
TAG=agy
CONV=7b193e4d-38f8-450c-8475-0b9ae0d04507
- Drop legacy Error Prone downgrade profiles (errorprone-jdk11, errorprone-jdk17)
  as Error Prone 2.43.0+ requires JDK 21+ execution.
- Scope `-XDaddTypeAnnotationsToSymbol=true` strictly to JDK 21 execution via
  dedicated `errorprone-jdk21` profile, setting default javac arg to benign `-g`.
  On JDK 22+ (including 25 and 26), the Javac fix is enabled by default.

Ref: google/error-prone#5426
BUG=b/481669998
TAG=agy
CONV=7b193e4d-38f8-450c-8475-0b9ae0d04507
Restore downgrade profiles (`errorprone-jdk11`, `errorprone-jdk17`) in parent POM
to ensure builds executed on older Javac compilers (JDK 8, 11, 17) use compatible
Error Prone versions (`2.38.0`, `2.42.0`).

BUG=b/481669998
TAG=agy
CONV=7b193e4d-38f8-450c-8475-0b9ae0d04507
Add comprehensive comments explaining the necessity of legacy Error Prone version
downgrades (`2.38.0`, `2.42.0`) for Java 8+ build compatibility. Clarify that
`-XDaddTypeAnnotationsToSymbol=true` is scoped specifically to JDK 21 execution
per Error Prone Issue #5426 and is omitted on JDK 22+ where the attribution fix
is enabled natively by default.

BUG=b/481669998
TAG=agy
CONV=7b193e4d-38f8-450c-8475-0b9ae0d04507
Remove outdated comment referencing unmanaged Error Prone Core synchronization
in `java-datastore/pom.xml`, as the version is now centrally managed by the top-level
parent POM.

Ref: https://github.com/googleapis/java-datastore/issues/1889
BUG=b/481669998
TAG=agy
CONV=7b193e4d-38f8-450c-8475-0b9ae0d04507
…tSubject

Inline `retryInfo.getRetryDelay()` calls within `retryInfoDelay()` subject assertion
to avoid fully qualified `com.google.protobuf.Duration` class reference per PR review.

BUG=b/481669998
TAG=agy
CONV=7b193e4d-38f8-450c-8475-0b9ae0d04507
Use CopyOnWriteArrayList instead of ArrayList in FakeBigtableService mock
implementation. The mock service receives gRPC requests on gRPC executor
threads and adds them to openSessionRequests and vrpcRequests. The test
thread reads these lists to verify client payloads. Without proper thread
synchronization, visibility and ordering issues can cause the test thread
to read a null element during ArrayList.add, resulting in a NullPointerException
in testMaterializedViewRequestSent.

BUG=b/481669998
TAG=agy
CONV=7b193e4d-38f8-450c-8475-0b9ae0d04507
…ava versions

- Update OS matrix to latest versions: ubuntu-24.04, windows-2025, macos-15 (ARM64)
- Expand Java matrix to include missing LTS versions (21, 25) and latest JDK 26

BUG=b/481669998
TAG=agy
CONV=7b193e4d-38f8-450c-8475-0b9ae0d04507
@lqiu96 lqiu96 force-pushed the add-jdk-26-support branch from 88c4fb6 to 90d0a41 Compare June 8, 2026 16:04
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.

1 participant