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-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org