FELIX-2945 : SCR plugin: Parsing of "options" for property tag broken for java annotations. Applied slightly modified patch from Stefan Seifert
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1102170 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/helper/PropertyHandler.java b/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/helper/PropertyHandler.java
index cfae583..46b02ef 100644
--- a/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/helper/PropertyHandler.java
+++ b/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/helper/PropertyHandler.java
@@ -171,13 +171,25 @@
} 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);