Author: markt
Date: Mon Jan 23 14:16:32 2017
New Revision: 1779932

URL: http://svn.apache.org/viewvc?rev=1779932&view=rev
Log:
Remove unused code, effectively reverting 1779370 and 1779612.
Java 9 is now handled in other branch of if/else.

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

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=1779932&r1=1779931&r2=1779932&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/buf/ByteBufferUtils.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/buf/ByteBufferUtils.java Mon Jan 
23 14:16:32 2017
@@ -23,7 +23,6 @@ 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.compat.JreCompat;
 import org.apache.tomcat.util.res.StringManager;
 
@@ -65,16 +64,9 @@ public class ByteBufferUtils {
                 Object cleanerObject = cleanerMethodLocal.invoke(tempBuffer);
                 cleanMethodLocal = cleanerObject.getClass().getMethod("clean");
                 cleanMethodLocal.invoke(cleanerObject);
-            } catch (Throwable t) {
-                JreCompat jreCompat = JreCompat.getInstance();
-                if (jreCompat.isInstanceOfInaccessibleObjectException(t)) {
-                    // Must be running on Java 9 without the necessary command 
line
-                    // options.
-                    
log.warn(sm.getString("byteBufferUtils.addExportsCleaner"));
-                } else {
-                    ExceptionUtils.handleThrowable(t);
-                }
-                log.warn(sm.getString("byteBufferUtils.cleaner"), t);
+            } catch (NoSuchMethodException | SecurityException | 
IllegalAccessException |
+                    IllegalArgumentException | InvocationTargetException e) {
+                log.warn(sm.getString("byteBufferUtils.cleaner"), e);
                 cleanerMethodLocal = null;
                 cleanMethodLocal = null;
             }

Modified: tomcat/trunk/java/org/apache/tomcat/util/buf/LocalStrings.properties
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/buf/LocalStrings.properties?rev=1779932&r1=1779931&r2=1779932&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/buf/LocalStrings.properties 
(original)
+++ tomcat/trunk/java/org/apache/tomcat/util/buf/LocalStrings.properties Mon 
Jan 23 14:16:32 2017
@@ -23,5 +23,4 @@ uDecoder.urlDecode.missingDigit=The % ch
 uDecoder.convertHexDigit.notHex=[{0}] is not a hexadecimal digit
 uDecoder.urlDecode.uee=Unable to URL decode the specified input since the 
encoding [{0}] is not supported.
 
-byteBufferUtils.addExportsCleaner=When running on Java 9 you need to add 
"--add-opens=java.base/java.nio=ALL-UNNAMED" to the JVM command line arguments 
to enable the direct ByteBuffer cleaner
 byteBufferUtils.cleaner=Cannot use direct ByteBuffer cleaner, memory leaking 
may occur



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

Reply via email to