FELIX-4774 : Support for @Reference annotation with unbind method "-"
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1660643 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/helper/Validator.java b/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/helper/Validator.java
index e6b1394..f680294 100644
--- a/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/helper/Validator.java
+++ b/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/helper/Validator.java
@@ -486,7 +486,12 @@
bindName = "bind" + Character.toUpperCase(ref.getName().charAt(0)) + ref.getName().substring(1);
}
if ( unbindName != null ) {
- unbindName = this.validateMethod(ref, unbindName, componentIsAbstract);
+ if ( "-".equals(unbindName) )
+ {
+ unbindName = null;
+ } else {
+ unbindName = this.validateMethod(ref, unbindName, componentIsAbstract);
+ }
} else {
unbindName = "unbind" + Character.toUpperCase(ref.getName().charAt(0)) + ref.getName().substring(1);
}
@@ -589,6 +594,10 @@
final ReferenceDescription ref,
final String methodName)
throws SCRDescriptorException {
+ if ( "-".equals(methodName) ) {
+ return null;
+ }
+
SpecVersion requiredVersion = SpecVersion.VERSION_1_0;
try {
final Class<?>[] sig = new Class<?>[] { project.getClassLoader().loadClass(TYPE_SERVICE_REFERENCE) };