Author: markt
Date: Wed Jan 18 18:46:27 2017
New Revision: 1779370

URL: http://svn.apache.org/viewvc?rev=1779370&view=rev
Log:
Java 9 can throw a Java 9 specific exception here (InaccessibleObjectException) 
so tweak the handling 

Modified:
    tomcat/trunk/java/org/apache/tomcat/util/buf/ByteBufferUtils.java

Modified: tomcat/trunk/java/org/apache/tomcat/util/buf/ByteBufferUtils.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/buf/ByteBufferUtils.java?rev=1779370&r1=1779369&r2=1779370&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/buf/ByteBufferUtils.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/buf/ByteBufferUtils.java Wed Jan 
18 18:46:27 2017
@@ -22,6 +22,7 @@ import java.nio.ByteBuffer;
 
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
+import org.apache.tomcat.util.ExceptionUtils;
 import org.apache.tomcat.util.res.StringManager;
 
 public class ByteBufferUtils {
@@ -46,9 +47,11 @@ public class ByteBufferUtils {
                 cleanMethodLocal = cleanerObject.getClass().getMethod("clean");
             }
             cleanMethodLocal.invoke(cleanerObject);
-        } catch (IllegalAccessException | IllegalArgumentException
-                | InvocationTargetException | NoSuchMethodException | 
SecurityException e) {
-            log.warn(sm.getString("byteBufferUtils.cleaner"), e);
+        } catch (Throwable t) {
+            // Use throwable as when running on Java 9 we may see a Java 9
+            // specific exception (InaccessibleObjectException) here.
+            ExceptionUtils.handleThrowable(t);
+            log.warn(sm.getString("byteBufferUtils.cleaner"), t);
             cleanerMethodLocal = null;
             cleanMethodLocal = null;
         }



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

Reply via email to