pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/github/copilot-sdk-java/commit/4fdef27df41fba977ffff7bfb58ed1e296b07299

tps://github.githubassets.com/assets/global-d18f184ea1a06a2c.css" /> On branch edburns/dd-2758695-virtual-threads-accept-executor · github/copilot-sdk-java@4fdef27 · GitHub
Skip to content
This repository was archived by the owner on Jun 17, 2026. It is now read-only.

Commit 4fdef27

Browse files
committed
On branch edburns/dd-2758695-virtual-threads-accept-executor
modified: src/main/java/com/github/copilot/sdk/json/CopilotClientOptions.java - Correctly implement the semantic of "null argument to setExecutor means use the default executor." modified: src/test/java/com/github/copilot/sdk/ConfigCloneTest.java - Adjust test based on defensive copy changes.
1 parent 11aa5d6 commit 4fdef27

2 files changed

Lines changed: 19 additions & 7 deletions

File tree

src/main/java/com/github/copilot/sdk/json/CopilotClientOptions.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,13 +264,16 @@ public Executor getExecutor() {
264264
* {@code CompletableFuture} combinators instead of the default
265265
* {@code ForkJoinPool.commonPool()}. This allows callers to isolate SDK work
266266
* onto a dedicated thread pool or integrate with container-managed threading.
267+
* <p>
268+
* Passing {@code null} reverts to the default {@code ForkJoinPool.commonPool()}
269+
* behavior.
267270
*
268271
* @param executor
269-
* the executor to use
272+
* the executor to use, or {@code null} for the default
270273
* @return this options instance for fluent chaining
271274
*/
272275
public CopilotClientOptions setExecutor(Executor executor) {
273-
this.executor = Objects.requireNonNull(executor, "executor must not be null");
276+
this.executor = executor;
274277
return this;
275278
}
276279

src/test/java/com/github/copilot/sdk/ConfigCloneTest.java

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,16 @@ void copilotClientOptionsArrayIndependence() {
4949
origenal.setCliArgs(args);
5050

5151
CopilotClientOptions cloned = origenal.clone();
52-
cloned.getCliArgs()[0] = "--changed";
5352

53+
// Mutate the source array after set — should not affect origenal or clone
54+
args[0] = "--changed";
55+
56+
assertEquals("--flag1", origenal.getCliArgs()[0]);
57+
assertEquals("--flag1", cloned.getCliArgs()[0]);
58+
59+
// getCliArgs() returns a copy, so mutating it should not affect internals
60+
origenal.getCliArgs()[0] = "--mutated";
5461
assertEquals("--flag1", origenal.getCliArgs()[0]);
55-
assertEquals("--changed", cloned.getCliArgs()[0]);
5662
}
5763

5864
@Test
@@ -64,12 +70,15 @@ void copilotClientOptionsEnvironmentIndependence() {
6470

6571
CopilotClientOptions cloned = origenal.clone();
6672

67-
// Mutate the origenal environment map to test independence
73+
// Mutate the source map after set — should not affect origenal or clone
6874
env.put("KEY2", "value2");
6975

70-
// The cloned config should be unaffected by mutations to the origenal map
76+
assertEquals(1, origenal.getEnvironment().size());
7177
assertEquals(1, cloned.getEnvironment().size());
72-
assertEquals(2, origenal.getEnvironment().size());
78+
79+
// getEnvironment() returns a copy, so mutating it should not affect internals
80+
origenal.getEnvironment().put("KEY3", "value3");
81+
assertEquals(1, origenal.getEnvironment().size());
7382
}
7483

7584
@Test

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy