You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2026/09/15 15:21:28 UTC

(tomcat) branch 10.1.x updated: Additional locations where ISE needs to be caught for Java 25

This is an automated email from the ASF dual-hosted git repository.

markt-asf pushed a commit to branch 10.1.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/10.1.x by this push:
     new 40a1759eb2 Additional locations where ISE needs to be caught for Java 25
40a1759eb2 is described below

commit 40a1759eb27ee76e2d3220552a48b9af6bb248ea
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Tue Sep 15 16:19:45 2026 +0100

    Additional locations where ISE needs to be caught for Java 25
---
 java/org/apache/tomcat/websocket/PerMessageDeflate.java | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/tomcat/websocket/PerMessageDeflate.java b/java/org/apache/tomcat/websocket/PerMessageDeflate.java
index d1b0dd110a..eaa55f8ad0 100644
--- a/java/org/apache/tomcat/websocket/PerMessageDeflate.java
+++ b/java/org/apache/tomcat/websocket/PerMessageDeflate.java
@@ -638,7 +638,8 @@ public class PerMessageDeflate implements Transformation {
                         int eomBufferWritten;
                         try {
                             eomBufferWritten = deflater.deflate(EOM_BUFFER, 0, EOM_BUFFER.length, Deflater.SYNC_FLUSH);
-                        } catch (NullPointerException e) {
+                        } catch (IllegalStateException | NullPointerException e) {
+                            // As of Java 25, the JRE throws an ISE rather than an NPE
                             throw new IOException(sm.getString("perMessageDeflate.alreadyClosed"), e);
                         }
                         if (eomBufferWritten < EOM_BUFFER.length) {
@@ -690,7 +691,8 @@ public class PerMessageDeflate implements Transformation {
         if (isServer && !serverContextTakeover || !isServer && !clientContextTakeover) {
             try {
                 deflater.reset();
-            } catch (NullPointerException e) {
+            } catch (IllegalStateException | NullPointerException e) {
+                // As of Java 25, the JRE throws an ISE rather than an NPE
                 throw new IOException(sm.getString("perMessageDeflate.alreadyClosed"), e);
             }
         }


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org