felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1102170 - /felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/helper/PropertyHandler.java
Date Thu, 12 May 2011 05:26:04 GMT
Author: cziegeler
Date: Thu May 12 05:26:03 2011
New Revision: 1102170

URL: http://svn.apache.org/viewvc?rev=1102170&view=rev
Log:
FELIX-2945 : SCR plugin: Parsing of "options" for property tag broken for java annotations.
Applied slightly modified patch from Stefan Seifert

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

Modified: felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/helper/PropertyHandler.java
URL: http://svn.apache.org/viewvc/felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/helper/PropertyHandler.java?rev=1102170&r1=1102169&r2=1102170&view=diff
==============================================================================
--- felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/helper/PropertyHandler.java
(original)
+++ felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/helper/PropertyHandler.java
Thu May 12 05:26:03 2011
@@ -171,13 +171,25 @@ public class PropertyHandler {
                 } else if (options != null) {
                     final String option = parameters[j];
                     final int pos = option.indexOf('=');
-                    if ( pos != -1 ) {
+                    if ( pos != -1 )
+                    {
+                        // handle options from javadoc comments
                         String optionLabel = option.substring(0, pos);
                         String optionValue = option.substring(pos + 1);
                         if (optionValue != null && optionValue.length() > 0 )
{
                             options.put(optionLabel, optionValue);
                         }
                     }
+                    else
+                    {
+                        // handle options from java annotations
+                        String optionLabel = parameters[j];
+                        String optionValue = (j < parameters.length-2) ? parameters[j+2]
: null;
+                        if (optionValue != null && "=".equals(parameters[j+1]) )
{
+                            options.put(optionLabel, optionValue);
+                        }
+                        j += 2;
+                    }
                 }
             }
             ad.setOptions(options);



Mime
View raw message