Fix the issue Felix-613
The extender pattern handler may not call the callback when a managed bundle is leaving. This issue is now solved, the handler always call the method regardless the instance state. Indeed, the instance must release all references on the leaving bundles.

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@673689 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/ipojo/extender.pattern.handler/src/main/java/org/apache/felix/ipojo/handler/extender/ExtenderManager.java b/ipojo/extender.pattern.handler/src/main/java/org/apache/felix/ipojo/handler/extender/ExtenderManager.java
index 69fdea3..fe8cea3 100644
--- a/ipojo/extender.pattern.handler/src/main/java/org/apache/felix/ipojo/handler/extender/ExtenderManager.java
+++ b/ipojo/extender.pattern.handler/src/main/java/org/apache/felix/ipojo/handler/extender/ExtenderManager.java
@@ -85,9 +85,9 @@
         String header = (String) headers.get(m_extension);

         if (header != null) {

             synchronized (this) {

-                m_bundleSet.add(bundle);

+                m_bundles.add(bundle);

             }

-            try {

+            try { // Call the callback outside the synchronized block.

                 m_onArrival.call(new Object[] {bundle, header});

             } catch (NoSuchMethodException e) {

                 m_handler.error("The onArrival method " + m_onArrival.getMethod() + " does not exist in the class", e);