FELIX-4170 : Deprecate inheritance of component descriptors
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1504107 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/scrplugin/generator/changelog.txt b/scrplugin/generator/changelog.txt
index ed93679..89d0afd 100644
--- a/scrplugin/generator/changelog.txt
+++ b/scrplugin/generator/changelog.txt
@@ -3,7 +3,8 @@
** Improvement
* [FELIX-4101] - Create metatype.properties file when description and label are inlined
* [FELIX-4126] - Discontinue creation of single XML descriptor files
-
+ * [FELIX-4170] - Deprecate inheritance of component descriptors
+
Changes from 1.7.0 to 1.6.0
---------------------------
diff --git a/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/SCRDescriptorGenerator.java b/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/SCRDescriptorGenerator.java
index 27310b3..add16d3 100644
--- a/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/SCRDescriptorGenerator.java
+++ b/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/SCRDescriptorGenerator.java
@@ -279,6 +279,7 @@
}
}
}
+
/**
* Create the SCR objects based on the descriptions
*/
@@ -344,6 +345,12 @@
inherit = (cd == null ? true : cd.isInherit());
if ( cd != null ) {
+ if ( current != desc ) {
+ iLog.addWarning(" Component " + componentDesc.getName() + " is using the " +
+ "deprecated inheritance feature and inherits from " + current.getDescribedClass().getName() +
+ ". This feature will be removed in future versions.",
+ desc.getSource());
+ }
// handle enabled and immediate
if ( componentDesc.getEnabled() == null ) {
componentDesc.setEnabled(cd.getEnabled());
@@ -370,12 +377,13 @@
// policy requires 1.1
componentDesc.setSpecVersion(SpecVersion.VERSION_1_1);
}
+
+ // services, properties, references
+ this.processServices(current, container);
+ this.processProperties(current, container, ocd);
+ this.processReferences(current, container);
}
- // services, properties, references
- this.processServices(current, container);
- this.processProperties(current, container, ocd);
- this.processReferences(current, container);
// go up in the class hierarchy
if ( !inherit || current.getDescribedClass().getSuperclass() == null ) {