openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r1681970 - /openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/NotificationManager.java
Date Wed, 27 May 2015 11:03:36 GMT
Author: struberg
Date: Wed May 27 11:03:36 2015
New Revision: 1681970

URL: http://svn.apache.org/r1681970
Log:
OWB-989 using entrySet is faster

Modified:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/NotificationManager.java

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/NotificationManager.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/NotificationManager.java?rev=1681970&r1=1681969&r2=1681970&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/NotificationManager.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/NotificationManager.java
Wed May 27 11:03:36 2015
@@ -344,15 +344,17 @@ public final class NotificationManager
 
         Set<Type> observedTypes = observers.keySet();
 
-        for (Type observedType : observedTypes)
+
+        for (Map.Entry<Type, Set<ObserverMethod<?>>> observerEntry : observers.entrySet())
         {
+            Type observedType = observerEntry.getKey();
             for (Type eventType : eventTypes)
             {
                 if ((ParameterizedType.class.isInstance(eventType) && Class.class.isInstance(observedType)
                         && GenericsUtil.isAssignableFrom(true, false, observedType,
ParameterizedType.class.cast(eventType).getRawType()))
                     || GenericsUtil.isAssignableFrom(true, false, observedType, eventType))
                 {
-                    Set<ObserverMethod<?>> observerMethods = observers.get(observedType);
+                    Set<ObserverMethod<?>> observerMethods = observerEntry.getValue();
 
                     for (ObserverMethod<?> observerMethod : observerMethods)
                     {



Mime
View raw message