felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@apache.org
Subject svn commit: r1708156 - /felix/trunk/framework/src/main/java/org/apache/felix/framework/HookRegistry.java
Date Mon, 12 Oct 2015 16:27:08 GMT
Author: davidb
Date: Mon Oct 12 16:27:08 2015
New Revision: 1708156

URL: http://svn.apache.org/viewvc?rev=1708156&view=rev
Log:
FELIX-5075 Framework hooks not re-sorted on service ranking update

Modified:
    felix/trunk/framework/src/main/java/org/apache/felix/framework/HookRegistry.java

Modified: felix/trunk/framework/src/main/java/org/apache/felix/framework/HookRegistry.java
URL: http://svn.apache.org/viewvc/felix/trunk/framework/src/main/java/org/apache/felix/framework/HookRegistry.java?rev=1708156&r1=1708155&r2=1708156&view=diff
==============================================================================
--- felix/trunk/framework/src/main/java/org/apache/felix/framework/HookRegistry.java (original)
+++ felix/trunk/framework/src/main/java/org/apache/felix/framework/HookRegistry.java Mon Oct
12 16:27:08 2015
@@ -159,8 +159,12 @@ public class HookRegistry
                     SortedSet<ServiceReference<?>> hooks = m_allHooks.get(serviceName);
                     if (hooks != null)
                     {
-                        hooks = new TreeSet<ServiceReference<?>>(hooks);
-                        m_allHooks.put(serviceName, hooks);
+                        TreeSet<ServiceReference<?>> newHooks = new TreeSet<ServiceReference<?>>(Collections.reverseOrder());
+                        for (ServiceReference<?> hook : hooks) {
+                            newHooks.add(hook); // addAll() does not re-sort
+                        }
+
+                        m_allHooks.put(serviceName, newHooks);
                     }
                 }
             }



Mime
View raw message