FELIX-2978 : Lookup reference policy does not work for inherited components
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1132653 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/scrplugin/generator/changelog.txt b/scrplugin/generator/changelog.txt
index 00e3756..01ebf3c 100644
--- a/scrplugin/generator/changelog.txt
+++ b/scrplugin/generator/changelog.txt
@@ -2,6 +2,7 @@
---------------------------
** Bug
+ * [FELIX-2978] - Lookup reference policy does not work for inherited components
* [FELIX-2945] - SCR plugin: Parsing of "options" for property tag broken for java annotations
* [FELIX-2906] - @Property(cardinality=Integer.MAX_Int, ...) causes java.lang.NumberFormatException
* [FELIX-2878] - scr- and bundle-plugin in multimodule project fails with goal "test"
diff --git a/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/xml/ComponentDescriptorIO.java b/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/xml/ComponentDescriptorIO.java
index c9c2445..1f7be91 100644
--- a/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/xml/ComponentDescriptorIO.java
+++ b/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/xml/ComponentDescriptorIO.java
@@ -18,25 +18,15 @@
*/
package org.apache.felix.scrplugin.xml;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
+import java.io.*;
import java.util.StringTokenizer;
import javax.xml.transform.TransformerException;
import org.apache.felix.scrplugin.Constants;
import org.apache.felix.scrplugin.SCRDescriptorException;
-import org.apache.felix.scrplugin.om.Component;
-import org.apache.felix.scrplugin.om.Components;
-import org.apache.felix.scrplugin.om.Implementation;
-import org.apache.felix.scrplugin.om.Interface;
-import org.apache.felix.scrplugin.om.Property;
-import org.apache.felix.scrplugin.om.Reference;
-import org.apache.felix.scrplugin.om.Service;
-import org.xml.sax.Attributes;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.SAXException;
+import org.apache.felix.scrplugin.om.*;
+import org.xml.sax.*;
import org.xml.sax.helpers.AttributesImpl;
import org.xml.sax.helpers.DefaultHandler;
@@ -350,6 +340,7 @@
if ( isScrPrivateFile ) {
IOUtils.addAttribute(ai, "checked", String.valueOf(reference.isChecked()));
+ IOUtils.addAttribute(ai, "strategy", reference.getStrategy());
}
IOUtils.indent(contentHandler, 2);
contentHandler.startElement(INNER_NAMESPACE_URI, ComponentDescriptorIO.REFERENCE, ComponentDescriptorIO.REFERENCE_QNAME, ai);
@@ -512,6 +503,9 @@
if ( attributes.getValue("checked") != null ) {
ref.setChecked(Boolean.valueOf(attributes.getValue("checked")).booleanValue());
}
+ if ( attributes.getValue("strategy") != null ) {
+ ref.setStrategy(attributes.getValue("strategy"));
+ }
this.currentComponent.addReference(ref);
}
diff --git a/scrplugin/maven-scr-plugin/changelog.txt b/scrplugin/maven-scr-plugin/changelog.txt
index 070397d..6c1912e 100644
--- a/scrplugin/maven-scr-plugin/changelog.txt
+++ b/scrplugin/maven-scr-plugin/changelog.txt
@@ -2,6 +2,7 @@
---------------------------
** Bug
+ * [FELIX-2978] - Lookup reference policy does not work for inherited components
* [FELIX-2945] - SCR plugin: Parsing of "options" for property tag broken for java annotations
* [FELIX-2906] - @Property(cardinality=Integer.MAX_Int, ...) causes java.lang.NumberFormatException
* [FELIX-2878] - scr- and bundle-plugin in multimodule project fails with goal "test"
diff --git a/scrplugin/scrtask/changelog.txt b/scrplugin/scrtask/changelog.txt
index 535d5c2..b9bb902 100644
--- a/scrplugin/scrtask/changelog.txt
+++ b/scrplugin/scrtask/changelog.txt
@@ -2,6 +2,7 @@
---------------------------
** Bug
+ * [FELIX-2978] - Lookup reference policy does not work for inherited components
* [FELIX-2945] - SCR plugin: Parsing of "options" for property tag broken for java annotations
* [FELIX-2906] - @Property(cardinality=Integer.MAX_Int, ...) causes java.lang.NumberFormatException