tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From isa...@apache.org
Subject svn commit: r1842748 - in /tomcat/trunk: java/org/apache/tomcat/util/compat/JrePlatform.java test/org/apache/tomcat/util/net/TesterSupport.java
Date Wed, 03 Oct 2018 18:16:36 GMT
Author: isapir
Date: Wed Oct  3 18:16:35 2018
New Revision: 1842748

URL: http://svn.apache.org/viewvc?rev=1842748&view=rev
Log:
Moved check of isMacOs() to o.a.t.util.compat.JrePlatform

Modified:
    tomcat/trunk/java/org/apache/tomcat/util/compat/JrePlatform.java
    tomcat/trunk/test/org/apache/tomcat/util/net/TesterSupport.java

Modified: tomcat/trunk/java/org/apache/tomcat/util/compat/JrePlatform.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/compat/JrePlatform.java?rev=1842748&r1=1842747&r2=1842748&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/compat/JrePlatform.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/compat/JrePlatform.java Wed Oct  3 18:16:35 2018
@@ -18,11 +18,13 @@ package org.apache.tomcat.util.compat;
 
 import java.security.AccessController;
 import java.security.PrivilegedAction;
+import java.util.Locale;
 
 public class JrePlatform {
 
     private static final String OS_NAME_PROPERTY = "os.name";
     private static final String OS_NAME_WINDOWS_PREFIX = "Windows";
+    private static final String OS_NAME_MAC_OS_LC_PREFIX = "mac os x";
 
     static {
         /*
@@ -51,9 +53,13 @@ public class JrePlatform {
                 });
         }
 
+        IS_MAC_OS = osName.toLowerCase(Locale.ENGLISH).startsWith(OS_NAME_MAC_OS_LC_PREFIX);
+
         IS_WINDOWS = osName.startsWith(OS_NAME_WINDOWS_PREFIX);
     }
 
 
+    public static final boolean IS_MAC_OS;
+
     public static final boolean IS_WINDOWS;
 }

Modified: tomcat/trunk/test/org/apache/tomcat/util/net/TesterSupport.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/tomcat/util/net/TesterSupport.java?rev=1842748&r1=1842747&r2=1842748&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/tomcat/util/net/TesterSupport.java (original)
+++ tomcat/trunk/test/org/apache/tomcat/util/net/TesterSupport.java Wed Oct  3 18:16:35 2018
@@ -26,7 +26,6 @@ import java.security.Principal;
 import java.security.PrivateKey;
 import java.security.cert.CertificateException;
 import java.security.cert.X509Certificate;
-import java.util.Locale;
 
 import javax.net.ssl.KeyManager;
 import javax.net.ssl.KeyManagerFactory;
@@ -53,6 +52,7 @@ import org.apache.catalina.startup.Tomca
 import org.apache.tomcat.jni.Library;
 import org.apache.tomcat.jni.LibraryNotFoundError;
 import org.apache.tomcat.jni.SSL;
+import org.apache.tomcat.util.compat.JrePlatform;
 import org.apache.tomcat.util.descriptor.web.LoginConfig;
 import org.apache.tomcat.util.descriptor.web.SecurityCollection;
 import org.apache.tomcat.util.descriptor.web.SecurityConstraint;
@@ -193,10 +193,6 @@ public final class TesterSupport {
         return ks;
     }
 
-    protected static boolean isMacOs() {
-        return System.getProperty("os.name").toLowerCase(Locale.ENGLISH).startsWith("mac
os x");
-    }
-
     protected static boolean isRenegotiationSupported(Tomcat tomcat) {
         String protocol = tomcat.getConnector().getProtocolHandlerClassName();
         if (protocol.contains("Apr")) {
@@ -213,7 +209,7 @@ public final class TesterSupport {
             // Disabled by default in 1.1.20 windows binary (2010-07-27)
             return false;
         }
-        if (protocol.contains("NioProtocol") || (protocol.contains("Nio2Protocol") &&
isMacOs())) {
+        if (protocol.contains("NioProtocol") || (protocol.contains("Nio2Protocol") &&
JrePlatform.IS_MAC_OS)) {
             // Doesn't work on all platforms - see BZ 56448.
             return false;
         }



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


Mime
View raw message