Fix issue FELIX-1319.
The overriding detection badly interpret the 'name' attribute of instance declaration. However, instance declaration must not impact the overriding detected. So, now instances are skipped.
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@793198 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/Pojoization.java b/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/Pojoization.java
index dd78c22..d782455 100644
--- a/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/Pojoization.java
+++ b/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/Pojoization.java
@@ -294,10 +294,12 @@
if (xml.isAnnotated()) {
boolean toskip = false;
for (int i = 0; !toskip && i < m_metadata.length; i++) {
- if (m_metadata[i].containsAttribute("name")
+ if (! m_metadata[i].getName().equals("instance") // Only if its a component type definition,
+ // so skip instance declaration
+ && m_metadata[i].containsAttribute("name")
&& m_metadata[i].getAttribute("name").equalsIgnoreCase(xml.getElem().getAttribute("name"))) {
toskip = true;
- warn("The component " + xml.getElem().getAttribute("name") + " is overriden by the metadata file");
+ warn("The component type " + xml.getElem().getAttribute("name") + " is overriden by the metadata file");
}
}
if (!toskip) {