This is an automated email from the ASF dual-hosted git repository. rmaucher pushed a commit to branch 9.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git
commit 2a14bba74a4777f6d8b75116e0855c2ea27600f0 Author: remm <[email protected]> AuthorDate: Fri Oct 16 17:41:23 2026 +0200 Java compatibility --- java/org/apache/tomcat/util/net/AbstractEndpoint.java | 4 ++-- java/org/apache/tomcat/util/threads/ThreadPoolExecutor.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/java/org/apache/tomcat/util/net/AbstractEndpoint.java b/java/org/apache/tomcat/util/net/AbstractEndpoint.java index bb354c2611..407686025b 100644 --- a/java/org/apache/tomcat/util/net/AbstractEndpoint.java +++ b/java/org/apache/tomcat/util/net/AbstractEndpoint.java @@ -1793,12 +1793,12 @@ public abstract class AbstractEndpoint<S, U> { } TaskQueue queue = (TaskQueue) tpe.getQueue(); queue.setParent(null); - } else if (executor instanceof VirtualThreadExecutor virtualThreadExecutor) { + } else if (executor instanceof VirtualThreadExecutor) { // The virtual thread executor accepts new tasks until it is shut // down. Shut it down, so tasks submitted via a reference captured // before this point are rejected, as they are with the thread // pool executor. - virtualThreadExecutor.shutdownNow(); + ((VirtualThreadExecutor) executor).shutdownNow(); } } } diff --git a/java/org/apache/tomcat/util/threads/ThreadPoolExecutor.java b/java/org/apache/tomcat/util/threads/ThreadPoolExecutor.java index 7eab514ccc..ff288f19b4 100644 --- a/java/org/apache/tomcat/util/threads/ThreadPoolExecutor.java +++ b/java/org/apache/tomcat/util/threads/ThreadPoolExecutor.java @@ -1672,7 +1672,7 @@ public class ThreadPoolExecutor extends AbstractExecutorService { final AtomicInteger purged = new AtomicInteger(0); try { q.removeIf(r -> { - if (r instanceof Future<?> future && future.isCancelled()) { + if (r instanceof Future<?> && ((Future<?>) r).isCancelled()) { purged.incrementAndGet(); return true; } @@ -1685,7 +1685,7 @@ public class ThreadPoolExecutor extends AbstractExecutorService { // before the interference occurred are already accounted for in // the purged count and will not appear in the copy taken below. for (Object r : q.toArray()) { - if (r instanceof Future<?> future && future.isCancelled() && q.remove(r)) { + if (r instanceof Future<?> && ((Future<?>) r).isCancelled() && q.remove(r)) { purged.incrementAndGet(); } } --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
