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 2014/07/24 15:18:40 UTC

svn commit: r1613113 - in /felix/trunk/scrplugin: ds-annotations/pom.xml ds-annotations/src/main/java/org/apache/felix/scrplugin/ds/DSAnnotationProcessor.java generator/src/main/java/org/apache/felix/scrplugin/annotations/ScannedAnnotation.java

Author: cziegeler
Date: Thu Jul 24 13:18:39 2014
New Revision: 1613113

URL: http://svn.apache.org/r1613113
Log:
FELIX-4296 : Cannot deactivate service interface detection in DS annotations

Modified:
    felix/trunk/scrplugin/ds-annotations/pom.xml
    felix/trunk/scrplugin/ds-annotations/src/main/java/org/apache/felix/scrplugin/ds/DSAnnotationProcessor.java
    felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/annotations/ScannedAnnotation.java

Modified: felix/trunk/scrplugin/ds-annotations/pom.xml
URL: http://svn.apache.org/viewvc/felix/trunk/scrplugin/ds-annotations/pom.xml?rev=1613113&r1=1613112&r2=1613113&view=diff
==============================================================================
--- felix/trunk/scrplugin/ds-annotations/pom.xml (original)
+++ felix/trunk/scrplugin/ds-annotations/pom.xml Thu Jul 24 13:18:39 2014
@@ -48,7 +48,7 @@
         <dependency>
             <groupId>org.apache.felix</groupId>
             <artifactId>org.apache.felix.scr.generator</artifactId>
-            <version>1.8.0</version>
+            <version>1.10.1-SNAPSHOT</version>
             <scope>provided</scope>
         </dependency>
         <dependency>

Modified: felix/trunk/scrplugin/ds-annotations/src/main/java/org/apache/felix/scrplugin/ds/DSAnnotationProcessor.java
URL: http://svn.apache.org/viewvc/felix/trunk/scrplugin/ds-annotations/src/main/java/org/apache/felix/scrplugin/ds/DSAnnotationProcessor.java?rev=1613113&r1=1613112&r2=1613113&view=diff
==============================================================================
--- felix/trunk/scrplugin/ds-annotations/src/main/java/org/apache/felix/scrplugin/ds/DSAnnotationProcessor.java (original)
+++ felix/trunk/scrplugin/ds-annotations/src/main/java/org/apache/felix/scrplugin/ds/DSAnnotationProcessor.java Thu Jul 24 13:18:39 2014
@@ -133,10 +133,12 @@ public class DSAnnotationProcessor imple
 
         // services
         final List<String> listedInterfaces = new ArrayList<String>();
-        if (cad.getValue("service") != null) {
+        if (cad.hasValue("service") ) {
             final String[] interfaces = (String[]) cad.getValue("service");
-            for (final String t : interfaces) {
-                listedInterfaces.add(t);
+            if ( interfaces != null ) {
+                for (final String t : interfaces) {
+                    listedInterfaces.add(t);
+                }
             }
         } else {
             // scan directly implemented interfaces

Modified: felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/annotations/ScannedAnnotation.java
URL: http://svn.apache.org/viewvc/felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/annotations/ScannedAnnotation.java?rev=1613113&r1=1613112&r2=1613113&view=diff
==============================================================================
--- felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/annotations/ScannedAnnotation.java (original)
+++ felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/annotations/ScannedAnnotation.java Thu Jul 24 13:18:39 2014
@@ -58,6 +58,20 @@ public abstract class ScannedAnnotation 
     }
 
     /**
+     * Check if a value exists for this annotation.
+     * This method can be used to check whether a value exists,
+     * even if the value is <code>null</code>.
+     * @param paramName The property name
+     * @return <code>true</code> If a value exists.
+     */
+    public boolean hasValue(final String paramName) {
+        if ( values != null ) {
+            return values.containsKey(paramName);
+        }
+        return false;
+    }
+
+    /**
      * Get a property value of the annotation.
      * @param paramName The property name.
      * @return The value of the property or <code>null</code>