felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1807680 - in /felix/trunk/tools/org.apache.felix.scr.ds-annotations: pom.xml src/main/java/org/apache/felix/scrplugin/ds/DSAnnotationProcessor.java
Date Fri, 08 Sep 2017 08:39:01 GMT
Author: cziegeler
Date: Fri Sep  8 08:39:01 2017
New Revision: 1807680

URL: http://svn.apache.org/viewvc?rev=1807680&view=rev
Log:
FELIX-5506 : OSGi's @Component parameter configurationPid is handled incorrectly. Apply patch
from Moritz Bechler

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

Modified: felix/trunk/tools/org.apache.felix.scr.ds-annotations/pom.xml
URL: http://svn.apache.org/viewvc/felix/trunk/tools/org.apache.felix.scr.ds-annotations/pom.xml?rev=1807680&r1=1807679&r2=1807680&view=diff
==============================================================================
--- felix/trunk/tools/org.apache.felix.scr.ds-annotations/pom.xml (original)
+++ felix/trunk/tools/org.apache.felix.scr.ds-annotations/pom.xml Fri Sep  8 08:39:01 2017
@@ -30,7 +30,7 @@
     <artifactId>org.apache.felix.scr.ds-annotations</artifactId>
 
     <!-- We use the same major version as the spec. -->
-    <version>1.2.9-SNAPSHOT</version>
+    <version>1.2.9-AG1</version>
     <packaging>jar</packaging>
 
     <name>Annotations for DS</name>
@@ -52,7 +52,7 @@
         <dependency>
             <groupId>org.apache.felix</groupId>
             <artifactId>org.apache.felix.scr.generator</artifactId>
-            <version>1.16.1-SNAPSHOT</version>
+            <version>1.16.0</version>
             <scope>provided</scope>
         </dependency>
         <dependency>

Modified: felix/trunk/tools/org.apache.felix.scr.ds-annotations/src/main/java/org/apache/felix/scrplugin/ds/DSAnnotationProcessor.java
URL: http://svn.apache.org/viewvc/felix/trunk/tools/org.apache.felix.scr.ds-annotations/src/main/java/org/apache/felix/scrplugin/ds/DSAnnotationProcessor.java?rev=1807680&r1=1807679&r2=1807680&view=diff
==============================================================================
--- felix/trunk/tools/org.apache.felix.scr.ds-annotations/src/main/java/org/apache/felix/scrplugin/ds/DSAnnotationProcessor.java
(original)
+++ felix/trunk/tools/org.apache.felix.scr.ds-annotations/src/main/java/org/apache/felix/scrplugin/ds/DSAnnotationProcessor.java
Fri Sep  8 08:39:01 2017
@@ -56,6 +56,7 @@ public class DSAnnotationProcessor imple
     /**
      * @see org.apache.felix.scrplugin.annotations.AnnotationProcessor#getName()
      */
+    @Override
     public String getName() {
         return "DS Annotation Processor";
     }
@@ -63,6 +64,7 @@ public class DSAnnotationProcessor imple
     /**
      * @see org.apache.felix.scrplugin.annotations.AnnotationProcessor#process(org.apache.felix.scrplugin.annotations.ScannedClass,
org.apache.felix.scrplugin.description.ClassDescription)
      */
+    @Override
     public void process(final ScannedClass scannedClass,
                         final ClassDescription describedClass)
     throws SCRDescriptorFailureException, SCRDescriptorException {
@@ -107,6 +109,7 @@ public class DSAnnotationProcessor imple
     /**
      * @see org.apache.felix.scrplugin.annotations.AnnotationProcessor#getRanking()
      */
+    @Override
     public int getRanking() {
         return 300;
     }
@@ -236,7 +239,14 @@ public class DSAnnotationProcessor imple
                         ComponentConfigurationPolicy.OPTIONAL.name())));
 
         // configuration pid
-        component.setConfigurationPid(cad.getStringValue("configurationPid", null));
+	    Object configPid = cad.getValue("configurationPid");
+        if ( configPid instanceof String ) {
+            component.setConfigurationPid((String)configPid);
+        } else if ( configPid instanceof String[] && ((String[])configPid).length
== 1 ) {
+            component.setConfigurationPid(((String[])configPid)[0]);
+        } else {
+            component.setConfigurationPid(null);
+        }
         component.setCreatePid(false);
 
         // no inheritance



Mime
View raw message