You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Alexander Klimetschek (JIRA)" <ji...@apache.org> on 2011/02/10 14:53:57 UTC
[jira] Created: (FELIX-2835) SCR plugin: Parsing of "options" for
property tag broken for javadoc annotations
SCR plugin: Parsing of "options" for property tag broken for javadoc annotations
--------------------------------------------------------------------------------
Key: FELIX-2835
URL: https://issues.apache.org/jira/browse/FELIX-2835
Project: Felix
Issue Type: Bug
Components: Maven SCR Plugin
Affects Versions: scr-1.6.0
Reporter: Alexander Klimetschek
A property with options should use the key=value parameters after the "options" parameter as name=label for the metatype options:
@scr.property type="String" value="one" options one="One" two="Two" three="Three"
However, it produces this single option:
<Option value="one=One" label="three=Three"/>
The problem is that this loop is inherently broken due to both a "j++" in the for loop and a "j += 2" at the end, and a parameters[j+2]:
for (int j=0; j < parameters.length; j++) {
if (Constants.PROPERTY_OPTIONS.equals(parameters[j])) {
options = new LinkedHashMap<String, String>();
} else if (options != null) {
String optionLabel = parameters[j];
String optionValue = (j < parameters.length-2) ? parameters[j+2] : null;
if (optionValue != null) {
options.put(optionLabel, optionValue);
}
j += 2;
}
}
Without having debugged it, I guess it should be parameters[j+1] and j+=1, as you only skip one parameter for reading the label, not two (given that one="One" is represented as two parameters "one" and "One").
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Resolved: (FELIX-2835) SCR plugin: Parsing of "options" for
property tag broken for javadoc annotations
Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FELIX-2835?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Carsten Ziegeler resolved FELIX-2835.
-------------------------------------
Resolution: Fixed
> SCR plugin: Parsing of "options" for property tag broken for javadoc annotations
> --------------------------------------------------------------------------------
>
> Key: FELIX-2835
> URL: https://issues.apache.org/jira/browse/FELIX-2835
> Project: Felix
> Issue Type: Bug
> Components: Maven SCR Plugin
> Affects Versions: maven-scr-plugin-1.6.0, scr generator 1.0.0
> Reporter: Alexander Klimetschek
> Assignee: Carsten Ziegeler
> Fix For: maven-scr-plugin-1.6.2, scr generator 1.0.2
>
>
> A property with options should use the key=value parameters after the "options" parameter as name=label for the metatype options:
> @scr.property type="String" value="one" options one="One" two="Two" three="Three"
> However, it produces this single option:
> <Option value="one=One" label="three=Three"/>
> The problem is that this loop in org.apache.felix.scrplugin.helper.PropertyHandler.processProperty() [0] is inherently broken due to both a "j++" in the for loop and a "j += 2" at the end, and a parameters[j+2]:
> for (int j=0; j < parameters.length; j++) {
> if (Constants.PROPERTY_OPTIONS.equals(parameters[j])) {
> options = new LinkedHashMap<String, String>();
> } else if (options != null) {
> String optionLabel = parameters[j];
> String optionValue = (j < parameters.length-2) ? parameters[j+2] : null;
> if (optionValue != null) {
> options.put(optionLabel, optionValue);
> }
> j += 2;
> }
> }
> Without having debugged it, I guess it should be parameters[j+1] and j+=1, as you only skip one parameter for reading the label, not two (given that one="One" is represented as two parameters "one" and "One").
> [0] http://svn.apache.org/repos/asf/felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/helper/PropertyHandler.java
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Updated: (FELIX-2835) SCR plugin: Parsing of "options" for
property tag broken for javadoc annotations
Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FELIX-2835?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Carsten Ziegeler updated FELIX-2835:
------------------------------------
Fix Version/s: scr ant task 1.0.2
> SCR plugin: Parsing of "options" for property tag broken for javadoc annotations
> --------------------------------------------------------------------------------
>
> Key: FELIX-2835
> URL: https://issues.apache.org/jira/browse/FELIX-2835
> Project: Felix
> Issue Type: Bug
> Components: Maven SCR Plugin
> Affects Versions: maven-scr-plugin-1.6.0, scr generator 1.0.0
> Reporter: Alexander Klimetschek
> Assignee: Carsten Ziegeler
> Fix For: maven-scr-plugin-1.7.0, scr ant task 1.0.2, scr generator 1.0.2
>
>
> A property with options should use the key=value parameters after the "options" parameter as name=label for the metatype options:
> @scr.property type="String" value="one" options one="One" two="Two" three="Three"
> However, it produces this single option:
> <Option value="one=One" label="three=Three"/>
> The problem is that this loop in org.apache.felix.scrplugin.helper.PropertyHandler.processProperty() [0] is inherently broken due to both a "j++" in the for loop and a "j += 2" at the end, and a parameters[j+2]:
> for (int j=0; j < parameters.length; j++) {
> if (Constants.PROPERTY_OPTIONS.equals(parameters[j])) {
> options = new LinkedHashMap<String, String>();
> } else if (options != null) {
> String optionLabel = parameters[j];
> String optionValue = (j < parameters.length-2) ? parameters[j+2] : null;
> if (optionValue != null) {
> options.put(optionLabel, optionValue);
> }
> j += 2;
> }
> }
> Without having debugged it, I guess it should be parameters[j+1] and j+=1, as you only skip one parameter for reading the label, not two (given that one="One" is represented as two parameters "one" and "One").
> [0] http://svn.apache.org/repos/asf/felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/helper/PropertyHandler.java
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Closed: (FELIX-2835) SCR plugin: Parsing of "options" for
property tag broken for javadoc annotations
Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FELIX-2835?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Carsten Ziegeler closed FELIX-2835.
-----------------------------------
> SCR plugin: Parsing of "options" for property tag broken for javadoc annotations
> --------------------------------------------------------------------------------
>
> Key: FELIX-2835
> URL: https://issues.apache.org/jira/browse/FELIX-2835
> Project: Felix
> Issue Type: Bug
> Components: Maven SCR Plugin
> Affects Versions: maven-scr-plugin-1.6.0, scr generator 1.0.0
> Reporter: Alexander Klimetschek
> Assignee: Carsten Ziegeler
> Fix For: maven-scr-plugin-1.7.0, scr ant task 1.1.0, scr generator 1.1.0
>
>
> A property with options should use the key=value parameters after the "options" parameter as name=label for the metatype options:
> @scr.property type="String" value="one" options one="One" two="Two" three="Three"
> However, it produces this single option:
> <Option value="one=One" label="three=Three"/>
> The problem is that this loop in org.apache.felix.scrplugin.helper.PropertyHandler.processProperty() [0] is inherently broken due to both a "j++" in the for loop and a "j += 2" at the end, and a parameters[j+2]:
> for (int j=0; j < parameters.length; j++) {
> if (Constants.PROPERTY_OPTIONS.equals(parameters[j])) {
> options = new LinkedHashMap<String, String>();
> } else if (options != null) {
> String optionLabel = parameters[j];
> String optionValue = (j < parameters.length-2) ? parameters[j+2] : null;
> if (optionValue != null) {
> options.put(optionLabel, optionValue);
> }
> j += 2;
> }
> }
> Without having debugged it, I guess it should be parameters[j+1] and j+=1, as you only skip one parameter for reading the label, not two (given that one="One" is represented as two parameters "one" and "One").
> [0] http://svn.apache.org/repos/asf/felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/helper/PropertyHandler.java
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Updated: (FELIX-2835) SCR plugin: Parsing of "options" for
property tag broken for javadoc annotations
Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FELIX-2835?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Carsten Ziegeler updated FELIX-2835:
------------------------------------
Affects Version/s: (was: scr-1.6.0)
maven-scr-plugin-1.6.0
scr generator 1.0.0
Fix Version/s: scr generator 1.0.2
maven-scr-plugin-1.6.2
Thanks for reporting!
Actually an option one="One" is a single parameter.
I fixed this in revision 1072066
> SCR plugin: Parsing of "options" for property tag broken for javadoc annotations
> --------------------------------------------------------------------------------
>
> Key: FELIX-2835
> URL: https://issues.apache.org/jira/browse/FELIX-2835
> Project: Felix
> Issue Type: Bug
> Components: Maven SCR Plugin
> Affects Versions: maven-scr-plugin-1.6.0, scr generator 1.0.0
> Reporter: Alexander Klimetschek
> Assignee: Carsten Ziegeler
> Fix For: maven-scr-plugin-1.6.2, scr generator 1.0.2
>
>
> A property with options should use the key=value parameters after the "options" parameter as name=label for the metatype options:
> @scr.property type="String" value="one" options one="One" two="Two" three="Three"
> However, it produces this single option:
> <Option value="one=One" label="three=Three"/>
> The problem is that this loop in org.apache.felix.scrplugin.helper.PropertyHandler.processProperty() [0] is inherently broken due to both a "j++" in the for loop and a "j += 2" at the end, and a parameters[j+2]:
> for (int j=0; j < parameters.length; j++) {
> if (Constants.PROPERTY_OPTIONS.equals(parameters[j])) {
> options = new LinkedHashMap<String, String>();
> } else if (options != null) {
> String optionLabel = parameters[j];
> String optionValue = (j < parameters.length-2) ? parameters[j+2] : null;
> if (optionValue != null) {
> options.put(optionLabel, optionValue);
> }
> j += 2;
> }
> }
> Without having debugged it, I guess it should be parameters[j+1] and j+=1, as you only skip one parameter for reading the label, not two (given that one="One" is represented as two parameters "one" and "One").
> [0] http://svn.apache.org/repos/asf/felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/helper/PropertyHandler.java
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Updated: (FELIX-2835) SCR plugin: Parsing of "options" for
property tag broken for javadoc annotations
Posted by "Alexander Klimetschek (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FELIX-2835?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Alexander Klimetschek updated FELIX-2835:
-----------------------------------------
Description:
A property with options should use the key=value parameters after the "options" parameter as name=label for the metatype options:
@scr.property type="String" value="one" options one="One" two="Two" three="Three"
However, it produces this single option:
<Option value="one=One" label="three=Three"/>
The problem is that this loop in org.apache.felix.scrplugin.helper.PropertyHandler.processProperty() [0] is inherently broken due to both a "j++" in the for loop and a "j += 2" at the end, and a parameters[j+2]:
for (int j=0; j < parameters.length; j++) {
if (Constants.PROPERTY_OPTIONS.equals(parameters[j])) {
options = new LinkedHashMap<String, String>();
} else if (options != null) {
String optionLabel = parameters[j];
String optionValue = (j < parameters.length-2) ? parameters[j+2] : null;
if (optionValue != null) {
options.put(optionLabel, optionValue);
}
j += 2;
}
}
Without having debugged it, I guess it should be parameters[j+1] and j+=1, as you only skip one parameter for reading the label, not two (given that one="One" is represented as two parameters "one" and "One").
[0] http://svn.apache.org/repos/asf/felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/helper/PropertyHandler.java
was:
A property with options should use the key=value parameters after the "options" parameter as name=label for the metatype options:
@scr.property type="String" value="one" options one="One" two="Two" three="Three"
However, it produces this single option:
<Option value="one=One" label="three=Three"/>
The problem is that this loop is inherently broken due to both a "j++" in the for loop and a "j += 2" at the end, and a parameters[j+2]:
for (int j=0; j < parameters.length; j++) {
if (Constants.PROPERTY_OPTIONS.equals(parameters[j])) {
options = new LinkedHashMap<String, String>();
} else if (options != null) {
String optionLabel = parameters[j];
String optionValue = (j < parameters.length-2) ? parameters[j+2] : null;
if (optionValue != null) {
options.put(optionLabel, optionValue);
}
j += 2;
}
}
Without having debugged it, I guess it should be parameters[j+1] and j+=1, as you only skip one parameter for reading the label, not two (given that one="One" is represented as two parameters "one" and "One").
> SCR plugin: Parsing of "options" for property tag broken for javadoc annotations
> --------------------------------------------------------------------------------
>
> Key: FELIX-2835
> URL: https://issues.apache.org/jira/browse/FELIX-2835
> Project: Felix
> Issue Type: Bug
> Components: Maven SCR Plugin
> Affects Versions: scr-1.6.0
> Reporter: Alexander Klimetschek
>
> A property with options should use the key=value parameters after the "options" parameter as name=label for the metatype options:
> @scr.property type="String" value="one" options one="One" two="Two" three="Three"
> However, it produces this single option:
> <Option value="one=One" label="three=Three"/>
> The problem is that this loop in org.apache.felix.scrplugin.helper.PropertyHandler.processProperty() [0] is inherently broken due to both a "j++" in the for loop and a "j += 2" at the end, and a parameters[j+2]:
> for (int j=0; j < parameters.length; j++) {
> if (Constants.PROPERTY_OPTIONS.equals(parameters[j])) {
> options = new LinkedHashMap<String, String>();
> } else if (options != null) {
> String optionLabel = parameters[j];
> String optionValue = (j < parameters.length-2) ? parameters[j+2] : null;
> if (optionValue != null) {
> options.put(optionLabel, optionValue);
> }
> j += 2;
> }
> }
> Without having debugged it, I guess it should be parameters[j+1] and j+=1, as you only skip one parameter for reading the label, not two (given that one="One" is represented as two parameters "one" and "One").
> [0] http://svn.apache.org/repos/asf/felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/helper/PropertyHandler.java
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Assigned: (FELIX-2835) SCR plugin: Parsing of "options" for
property tag broken for javadoc annotations
Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FELIX-2835?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Carsten Ziegeler reassigned FELIX-2835:
---------------------------------------
Assignee: Carsten Ziegeler
> SCR plugin: Parsing of "options" for property tag broken for javadoc annotations
> --------------------------------------------------------------------------------
>
> Key: FELIX-2835
> URL: https://issues.apache.org/jira/browse/FELIX-2835
> Project: Felix
> Issue Type: Bug
> Components: Maven SCR Plugin
> Affects Versions: scr-1.6.0
> Reporter: Alexander Klimetschek
> Assignee: Carsten Ziegeler
>
> A property with options should use the key=value parameters after the "options" parameter as name=label for the metatype options:
> @scr.property type="String" value="one" options one="One" two="Two" three="Three"
> However, it produces this single option:
> <Option value="one=One" label="three=Three"/>
> The problem is that this loop in org.apache.felix.scrplugin.helper.PropertyHandler.processProperty() [0] is inherently broken due to both a "j++" in the for loop and a "j += 2" at the end, and a parameters[j+2]:
> for (int j=0; j < parameters.length; j++) {
> if (Constants.PROPERTY_OPTIONS.equals(parameters[j])) {
> options = new LinkedHashMap<String, String>();
> } else if (options != null) {
> String optionLabel = parameters[j];
> String optionValue = (j < parameters.length-2) ? parameters[j+2] : null;
> if (optionValue != null) {
> options.put(optionLabel, optionValue);
> }
> j += 2;
> }
> }
> Without having debugged it, I guess it should be parameters[j+1] and j+=1, as you only skip one parameter for reading the label, not two (given that one="One" is represented as two parameters "one" and "One").
> [0] http://svn.apache.org/repos/asf/felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/helper/PropertyHandler.java
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira