openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From martink...@apache.org
Subject svn commit: r1235378 - /openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/el/ELContextStore.java
Date Tue, 24 Jan 2012 17:53:11 GMT
Author: martinkoci
Date: Tue Jan 24 17:53:11 2012
New Revision: 1235378

URL: http://svn.apache.org/viewvc?rev=1235378&view=rev
Log:
OWB-637 [perf] ELContextStore.destroyDependents() creates unnecessary HashMap$KeyIterator
instances

Modified:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/el/ELContextStore.java

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/el/ELContextStore.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/el/ELContextStore.java?rev=1235378&r1=1235377&r2=1235378&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/el/ELContextStore.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/el/ELContextStore.java
Tue Jan 24 17:53:11 2012
@@ -197,15 +197,18 @@ public class ELContextStore
      */
     public void destroyDependents()
     {
-        Set<Bean<?>> beans = dependentObjects.keySet();
-        for(Bean<?> bean : beans)
+        if (dependentObjects.size() > 0)
         {
-            Bean<Object> o = (Bean<Object>)bean;
-            CreationalStore store = dependentObjects.get(bean);
-            o.destroy(store.getObject(), (CreationalContext<Object>)store.getCreational());
-        }
+            Set<Bean<?>> beans = dependentObjects.keySet();
+            for(Bean<?> bean : beans)
+            {
+                Bean<Object> o = (Bean<Object>)bean;
+                CreationalStore store = dependentObjects.get(bean);
+                o.destroy(store.getObject(), (CreationalContext<Object>)store.getCreational());
+            }
 
-        dependentObjects.clear();
+            dependentObjects.clear();
+        }
         beanNameToDependentBeanMapping.clear();
     }
 



Mime
View raw message