tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1725601 - /tomcat/trunk/java/org/apache/catalina/util/LifecycleBase.java
Date Tue, 19 Jan 2016 19:40:31 GMT
Author: markt
Date: Tue Jan 19 19:40:31 2016
New Revision: 1725601

URL: http://svn.apache.org/viewvc?rev=1725601&view=rev
Log:
Avoid users of Lifecycle objects having to figure out if they need to call destroy or not.

Modified:
    tomcat/trunk/java/org/apache/catalina/util/LifecycleBase.java

Modified: tomcat/trunk/java/org/apache/catalina/util/LifecycleBase.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/util/LifecycleBase.java?rev=1725601&r1=1725600&r2=1725601&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/util/LifecycleBase.java (original)
+++ tomcat/trunk/java/org/apache/catalina/util/LifecycleBase.java Tue Jan 19 19:40:31 2016
@@ -277,11 +277,12 @@ public abstract class LifecycleBase impl
 
             if (log.isDebugEnabled()) {
                 Exception e = new LifecycleException();
-                log.debug(sm.getString("lifecycleBase.alreadyDestroyed",
-                        toString()), e);
-            } else if (log.isInfoEnabled()) {
-                log.info(sm.getString("lifecycleBase.alreadyDestroyed",
-                        toString()));
+                log.debug(sm.getString("lifecycleBase.alreadyDestroyed", toString()), e);
+            } else if (log.isInfoEnabled() && !(this instanceof Lifecycle.SingleUse))
{
+                // Rather than have every component that might need to call
+                // destroy() check for SingleUse, don't log an info message if
+                // multiple calls are made to destroy()
+                log.info(sm.getString("lifecycleBase.alreadyDestroyed", toString()));
             }
 
             return;



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


Mime
View raw message