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 2014/05/08 21:21:49 UTC
svn commit: r1593390 - in /tomcat/tc7.0.x/trunk: ./
java/org/apache/catalina/core/NamingContextListener.java
Author: kkolinko
Date: Thu May 8 19:21:49 2014
New Revision: 1593390
URL: http://svn.apache.org/r1593390
Log:
Merged r1593387 from tomcat/trunk:
Small optimization: move "getRegistry(null, null)" call out of the loop.
Modified:
tomcat/tc7.0.x/trunk/ (props changed)
tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/NamingContextListener.java
Propchange: tomcat/tc7.0.x/trunk/
------------------------------------------------------------------------------
Merged /tomcat/trunk:r1593387
Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/NamingContextListener.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/NamingContextListener.java?rev=1593390&r1=1593389&r2=1593390&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/NamingContextListener.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/NamingContextListener.java Thu May 8 19:21:49 2014
@@ -337,9 +337,12 @@ public class NamingContextListener
ContextAccessController.unsetSecurityToken(container, container);
// unregister mbeans.
- Collection<ObjectName> names = objectNames.values();
- for (ObjectName objectName : names) {
- Registry.getRegistry(null, null).unregisterComponent(objectName);
+ if (!objectNames.isEmpty()) {
+ Collection<ObjectName> names = objectNames.values();
+ Registry registry = Registry.getRegistry(null, null);
+ for (ObjectName objectName : names) {
+ registry.unregisterComponent(objectName);
+ }
}
} finally {
objectNames.clear();
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org