feat(java): add JDK 25 default executor#1469
Closed
brunoborges wants to merge 4 commits into
Closed
Conversation
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>
Contributor
There was a problem hiding this comment.
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 wireCopilotClientto 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
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>
Collaborator
|
@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. |
Collaborator
|
Superseded by #1477 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Validation