FELIX-3550 : Reimplement the SCR Generator
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1356844 13f79535-47bb-0310-9956-ffa450edef68
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 c7f7140..a78dc38 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
@@ -203,7 +203,7 @@
// we look for the bind/unbind methods
// and create them if they are not availabe
if (ref.getStrategy() != ReferenceStrategy.LOOKUP && ref.getField() != null
- && ref.getField().getClass().getName().equals(container.getClassDescription().getDescribedClass().getName())
+ && ref.getField().getDeclaringClass().getName().equals(container.getClassDescription().getDescribedClass().getName())
&& (ref.getCardinality() == ReferenceCardinality.OPTIONAL_UNARY || ref.getCardinality() == ReferenceCardinality.MANDATORY_UNARY)) {
final String bindValue = ref.getBind();
@@ -226,11 +226,11 @@
if (createBind || createUnbind) {
// logging
if ( createBind && createUnbind ) {
- this.logger.debug("Generating bind and unbind method for " + name + " in " + container.getClassDescription().getClass().getName());
+ this.logger.debug("Generating bind and unbind method for " + name + " in " + container.getClassDescription().getDescribedClass().getName());
} else if ( createBind ) {
- this.logger.debug("Generating bind method for " + name + " in " + container.getClassDescription().getClass().getName());
+ this.logger.debug("Generating bind method for " + name + " in " + container.getClassDescription().getDescribedClass().getName());
} else {
- this.logger.debug("Generating unbind method for " + name + " in " + container.getClassDescription().getClass().getName());
+ this.logger.debug("Generating unbind method for " + name + " in " + container.getClassDescription().getDescribedClass().getName());
}
ClassModifier.addMethods(container.getClassDescription().getDescribedClass().getName(),