You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by kk...@apache.org on 2011/11/12 04:50:51 UTC

svn commit: r1201180 - /tomcat/trunk/java/org/apache/catalina/core/AprLifecycleListener.java

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