Skip to content

Commit 6c95ba8

Browse files
committed
only try if > 21
1 parent 870ec24 commit 6c95ba8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

http-client/src/main/java/io/avaje/http/client/DHttpClientBuilder.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ private java.net.http.HttpClient defaultClient() {
105105
}
106106
if (executor != null) {
107107
builder.executor(executor);
108-
} else {
108+
} else if (Integer.getInteger("java.specification.version") >= 21) {
109109
try {
110110
ExecutorService virtualExecutorService =
111111
(ExecutorService)
@@ -117,7 +117,7 @@ private java.net.http.HttpClient defaultClient() {
117117
.invokeExact();
118118
builder.executor(virtualExecutorService);
119119
} catch (Throwable t) {
120-
// Nothing to do
120+
// Impossible
121121
}
122122
}
123123
if (proxy != null) {

0 commit comments

Comments
 (0)