Skip to content

feat(java): add JDK 25 default executor#1469

Closed
brunoborges wants to merge 4 commits into
github:mainfrom
brunoborges:brunoborges/java-jdk25-default-executor
Closed

feat(java): add JDK 25 default executor#1469
brunoborges wants to merge 4 commits into
github:mainfrom
brunoborges:brunoborges/java-jdk25-default-executor

Conversation

@brunoborges
Copy link
Copy Markdown
Contributor

@brunoborges brunoborges commented May 27, 2026

Summary

  • add a Java multi-release default executor provider for the Java SDK
  • use virtual-thread-per-task executor automatically on JDK 25+ and ForkJoinPool.commonPool() on older JDKs
  • make CopilotClient use a non-null executor while only shutting down SDK-owned defaults
  • update Java docs and add executor provider tests

Validation

  • cd java && mvn spotless:check -DskipTests
  • cd java && mvn package -DskipTests
  • cd java && mvn test -Dtest=DefaultExecutorProviderTest,ExecutorWiringTest
  • inspected built JAR for META-INF/versions/25/com/github/copilot/DefaultExecutorProvider.class and Multi-Release: true

Use a multi-release JAR to select virtual threads as the default internal executor on JDK 25+, while retaining the common pool on older JDKs. Keep user-provided executors caller-owned and only shut down SDK-owned defaults.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 27, 2026 19:15
@brunoborges brunoborges requested a review from a team as a code owner May 27, 2026 19:15
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds a multi-release Java build to switch the SDK’s default internal executor to virtual threads on JDK 25+ while keeping ForkJoinPool.commonPool() on earlier JDKs, and updates lifecycle handling and docs accordingly.

Changes:

  • Introduce DefaultExecutorProvider (base + JDK 25 multi-release variant) and wire CopilotClient to consistently use a resolved executor and shut down only SDK-owned executors.
  • Add tests validating default executor selection/ownership semantics, including a multi-release JAR behavior check.
  • Update Maven build (multi-release compilation + JaCoCo exclusions) and README/docs for the new default behavior.
Show a summary per file
File Description
java/src/main/java/com/github/copilot/DefaultExecutorProvider.java Base default executor provider for pre-25 JDKs (common pool).
java/src/main/java25/com/github/copilot/DefaultExecutorProvider.java JDK 25+ multi-release provider returning a virtual-thread executor.
java/src/main/java/com/github/copilot/CopilotClient.java Centralizes executor selection and adds shutdown of SDK-owned executors on close/forceStop.
java/src/main/java/com/github/copilot/rpc/CopilotClientOptions.java Clarifies executor option semantics and ownership responsibilities in Javadoc.
java/src/test/java/com/github/copilot/DefaultExecutorProviderTest.java Adds tests for executor ownership and multi-release selection behavior.
java/pom.xml Adds JDK 25+ multi-release compilation profile and excludes versioned classes from JaCoCo report analysis.
java/README.md Updates guidance to reflect automatic virtual-thread usage on JDK 25+.

Copilot's findings

  • Files reviewed: 7/7 changed files
  • Comments generated: 4

Comment thread java/src/main/java/com/github/copilot/CopilotClient.java Outdated
Comment thread java/pom.xml
Comment thread java/src/main/java/com/github/copilot/CopilotClient.java
brunoborges and others added 3 commits May 27, 2026 15:23
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@edburns
Copy link
Copy Markdown
Collaborator

edburns commented May 27, 2026

@brunoborges I'm going to try to get this in, but I must move github/copilot-sdk-java#232 over first. I'm working on a PR for that now.

I'll make this as Draft to prevent accidental merging.

@edburns edburns marked this pull request as draft May 27, 2026 22:25
@edburns
Copy link
Copy Markdown
Collaborator

edburns commented May 28, 2026

Superseded by #1477

@edburns edburns closed this May 28, 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