tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kkoli...@apache.org
Subject svn commit: r1201180 - /tomcat/trunk/java/org/apache/catalina/core/AprLifecycleListener.java
Date Sat, 12 Nov 2011 03:50:51 GMT
Author: kkolinko
Date: Sat Nov 12 03:50:51 2011
New Revision: 1201180

URL: http://svn.apache.org/viewvc?rev=1201180&view=rev
Log:
Check state and throw ISE only if the new value differs from the old one.
Throws NPE for invalid null values.

Modified:
    tomcat/trunk/java/org/apache/catalina/core/AprLifecycleListener.java

Modified: tomcat/trunk/java/org/apache/catalina/core/AprLifecycleListener.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/AprLifecycleListener.java?rev=1201180&r1=1201179&r2=1201180&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/AprLifecycleListener.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/AprLifecycleListener.java Sat Nov 12 03:50:51
2011
@@ -277,13 +277,15 @@ public class AprLifecycleListener
     }
 
     public void setSSLEngine(String SSLEngine) {
-        // Ensure that the SSLEngine is consistent with that used for SSL init
-        if (sslInitialized) {
-            throw new IllegalStateException(
-                    sm.getString("aprListener.tooLateForSSLEngine"));
-        }
+        if (!SSLEngine.equals(AprLifecycleListener.SSLEngine)) {
+            // Ensure that the SSLEngine is consistent with that used for SSL init
+            if (sslInitialized) {
+                throw new IllegalStateException(
+                        sm.getString("aprListener.tooLateForSSLEngine"));
+            }
 
-        AprLifecycleListener.SSLEngine = SSLEngine;
+            AprLifecycleListener.SSLEngine = SSLEngine;
+        }
     }
 
     public String getSSLRandomSeed() {
@@ -291,13 +293,15 @@ public class AprLifecycleListener
     }
 
     public void setSSLRandomSeed(String SSLRandomSeed) {
-        // Ensure that the random seed is consistent with that used for SSL init
-        if (sslInitialized) {
-            throw new IllegalStateException(
-                    sm.getString("aprListener.tooLateForSSLRandomSeed"));
-        }
+        if (!SSLRandomSeed.equals(AprLifecycleListener.SSLRandomSeed)) {
+            // Ensure that the random seed is consistent with that used for SSL init
+            if (sslInitialized) {
+                throw new IllegalStateException(
+                        sm.getString("aprListener.tooLateForSSLRandomSeed"));
+            }
 
-        AprLifecycleListener.SSLRandomSeed = SSLRandomSeed;
+            AprLifecycleListener.SSLRandomSeed = SSLRandomSeed;
+        }
     }
 
     public String getFIPSMode() {
@@ -305,13 +309,15 @@ public class AprLifecycleListener
     }
 
     public void setFIPSMode(String FIPSMode) {
-        // Ensure that the FIPS mode is consistent with that used for SSL init
-        if (sslInitialized) {
-            throw new IllegalStateException(
-                    sm.getString("aprListener.tooLateForFIPSMode"));
-        }
+        if (!FIPSMode.equals(AprLifecycleListener.FIPSMode)) {
+            // Ensure that the FIPS mode is consistent with that used for SSL init
+            if (sslInitialized) {
+                throw new IllegalStateException(
+                        sm.getString("aprListener.tooLateForFIPSMode"));
+            }
 
-        AprLifecycleListener.FIPSMode = FIPSMode;
+            AprLifecycleListener.FIPSMode = FIPSMode;
+        }
     }
 
     public boolean isFIPSModeActive() {



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


Mime
View raw message