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

remm 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 730310c69b Remove unused code
730310c69b is described below

commit 730310c69b46104657f3e593d7b4d98d34844b8b
Author: remm <r...@apache.org>
AuthorDate: Thu Sep 12 11:19:13 2024 +0200

    Remove unused code
---
 java/org/apache/tomcat/util/buf/ByteBufferUtils.java | 17 +----------------
 1 file changed, 1 insertion(+), 16 deletions(-)

diff --git a/java/org/apache/tomcat/util/buf/ByteBufferUtils.java 
b/java/org/apache/tomcat/util/buf/ByteBufferUtils.java
index db1f68287d..552ce94c3a 100644
--- a/java/org/apache/tomcat/util/buf/ByteBufferUtils.java
+++ b/java/org/apache/tomcat/util/buf/ByteBufferUtils.java
@@ -31,14 +31,10 @@ public class ByteBufferUtils {
     private static final Log log = LogFactory.getLog(ByteBufferUtils.class);
 
     private static final Object unsafe;
-    private static final Method cleanerMethod;
-    private static final Method cleanMethod;
     private static final Method invokeCleanerMethod;
 
     static {
         ByteBuffer tempBuffer = ByteBuffer.allocateDirect(0);
-        Method cleanerMethodLocal = null;
-        Method cleanMethodLocal = null;
         Object unsafeLocal = null;
         Method invokeCleanerMethodLocal = null;
         try {
@@ -54,8 +50,6 @@ public class ByteBufferUtils {
             unsafeLocal = null;
             invokeCleanerMethodLocal = null;
         }
-        cleanerMethod = cleanerMethodLocal;
-        cleanMethod = cleanMethodLocal;
         unsafe = unsafeLocal;
         invokeCleanerMethod = invokeCleanerMethodLocal;
     }
@@ -101,16 +95,7 @@ public class ByteBufferUtils {
     }
 
     public static void cleanDirectBuffer(ByteBuffer buf) {
-        if (cleanMethod != null) {
-            try {
-                cleanMethod.invoke(cleanerMethod.invoke(buf));
-            } catch (IllegalAccessException | IllegalArgumentException | 
InvocationTargetException |
-                    SecurityException e) {
-                if (log.isDebugEnabled()) {
-                    log.debug(sm.getString("byteBufferUtils.cleaner"), e);
-                }
-            }
-        } else if (invokeCleanerMethod != null) {
+        if (invokeCleanerMethod != null) {
             try {
                 invokeCleanerMethod.invoke(unsafe, buf);
             } catch (IllegalAccessException | IllegalArgumentException | 
InvocationTargetException |


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

Reply via email to