You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by cz...@apache.org on 2015/02/18 16:02:56 UTC

svn commit: r1660643 - /felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/helper/Validator.java

Author: cziegeler
Date: Wed Feb 18 15:02:55 2015
New Revision: 1660643

URL: http://svn.apache.org/r1660643
Log:
FELIX-4774 : Support for @Reference annotation with unbind method "-"

Modified:
    felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/helper/Validator.java

Modified: felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/helper/Validator.java
URL: http://svn.apache.org/viewvc/felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/helper/Validator.java?rev=1660643&r1=1660642&r2=1660643&view=diff
==============================================================================
--- felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/helper/Validator.java (original)
+++ felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/helper/Validator.java Wed Feb 18 15:02:55 2015
@@ -486,7 +486,12 @@ public class Validator {
                     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 @@ public class Validator {
                     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) };