Fix a bug in the Dependency Handler Description when the "instance.name" property is not set.
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@580009 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/dependency/DependencyHandlerDescription.java b/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/dependency/DependencyHandlerDescription.java
index 225b215..db62073 100644
--- a/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/dependency/DependencyHandlerDescription.java
+++ b/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/dependency/DependencyHandlerDescription.java
@@ -25,6 +25,7 @@
import org.apache.felix.ipojo.architecture.HandlerDescription;
import org.apache.felix.ipojo.metadata.Attribute;
import org.apache.felix.ipojo.metadata.Element;
+import org.osgi.framework.Constants;
import org.osgi.framework.ServiceReference;
/**
@@ -112,7 +113,7 @@
while (it.hasNext()) {
Element use = new Element("Uses", "");
ServiceReference ref = (ServiceReference) it.next();
- use.addAttribute(new Attribute("instance.name", ref.getProperty("instance.name").toString()));
+ use.addAttribute(new Attribute("service.id", ref.getProperty(Constants.SERVICE_ID).toString()));
String in = (String) ref.getProperty("instance.name");
if (in != null) {
use.addAttribute(new Attribute("instance.name", in));