openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r1830461 - /openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/NotificationManager.java
Date Sat, 28 Apr 2018 16:23:30 GMT
Author: struberg
Date: Sat Apr 28 16:23:30 2018
New Revision: 1830461

URL: http://svn.apache.org/viewvc?rev=1830461&view=rev
Log:
OWB-1243 no need to sort if there is only one observer


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=1830461&r1=1830460&r2=1830461&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
Sat Apr 28 16:23:30 2018
@@ -688,7 +688,10 @@ public final class NotificationManager
         }
 
         // new in CDI-2.0: sort observers
-        observerMethods.sort(Comparator.comparingInt(ObserverMethod::getPriority));
+        if (observerMethods.size() > 1)
+        {
+            observerMethods.sort(Comparator.comparingInt(ObserverMethod::getPriority));
+        }
 
         List<CompletableFuture<Void>> completableFutures = async ? new ArrayList<>()
: null;
 



Mime
View raw message