Applied patch (FELIX-273) to correctly dispose created component 
instances once a factory goes away.


git-svn-id: https://svn.apache.org/repos/asf/incubator/felix/trunk@531477 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/ipojo/src/main/java/org/apache/felix/ipojo/InstanceCreator.java b/ipojo/src/main/java/org/apache/felix/ipojo/InstanceCreator.java
index 2254a1a..65dd0ca 100644
--- a/ipojo/src/main/java/org/apache/felix/ipojo/InstanceCreator.java
+++ b/ipojo/src/main/java/org/apache/felix/ipojo/InstanceCreator.java
@@ -218,7 +218,7 @@
         m_context.removeServiceListener(this);
         for (int i = 0; i < m_configurations.length; i++) {
             if (m_configurations[i].getInstance() != null) {
-                m_configurations[i].getInstance().stop();
+                m_configurations[i].getInstance().dispose();
             }
             m_configurations[i].setInstance(null);
             m_configurations[i].setFactory(null);
diff --git a/ipojo/src/main/java/org/apache/felix/ipojo/architecture/ComponentDescription.java b/ipojo/src/main/java/org/apache/felix/ipojo/architecture/ComponentDescription.java
index 6826c70..45e23ad 100644
--- a/ipojo/src/main/java/org/apache/felix/ipojo/architecture/ComponentDescription.java
+++ b/ipojo/src/main/java/org/apache/felix/ipojo/architecture/ComponentDescription.java
@@ -109,6 +109,10 @@
      * @param pd : the property to add
      */
     public void addProperty(PropertyDescription pd) {
+        if (pd.getName().equals("name")) {
+            pd = new PropertyDescription(pd.getName(), pd.getType(), null); // Erase the instance name
+        }
+        
         for (int i = 0; i < m_properties.length; i++) {
             if (m_properties[i].getName().equals(pd.getName())) {
                 return;