You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Dave Robinson (JIRA)" <de...@myfaces.apache.org> on 2009/10/06 22:36:31 UTC

[jira] Created: (TRINIDAD-1587) maven-faces-plugin should allow java compatible variable names when converting list value of "-1"

maven-faces-plugin should allow java compatible variable names when converting list value of  "-1"
--------------------------------------------------------------------------------------------------

                 Key: TRINIDAD-1587
                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1587
             Project: MyFaces Trinidad
          Issue Type: Bug
         Environment: Any
            Reporter: Dave Robinson
            Priority: Minor


If you are using the component generator (MyFacesComponentGenerator.java) then you could end up with an invalid generated java file attribute name when converting a property that has as an allowed value of "-1". 

For example, having property 'size' with allowed values of "-1 0 1" results in 2 ok properties for 0 and 1:

private String size0;
private String size1;

but an invalid definition of:

private String size-1;

A good solution would be to look for a leading nonA-Z, non0-9 character and replacing it with a valid character.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TRINIDAD-1587) maven-faces-plugin should allow java compatible variable names when converting list value of "-1"

Posted by "Dave Robinson (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TRINIDAD-1587?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12768910#action_12768910 ] 

Dave Robinson commented on TRINIDAD-1587:
-----------------------------------------

Here's some example xml to cause this:

    <property>
      <property-name>size</property-name>
      <property-class>int</property-class>
      <default-value>-1</default-value>
      <property-extension>
        <fmd:property-metadata>
          <fmd:required>false</fmd:required>
          <fmd:property-values>-1 0 1 2 </fmd:property-values>
        </fmd:property-metadata>
      </property-extension>
    </property>

> maven-faces-plugin should allow java compatible variable names when converting list value of  "-1"
> --------------------------------------------------------------------------------------------------
>
>                 Key: TRINIDAD-1587
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1587
>             Project: MyFaces Trinidad
>          Issue Type: Bug
>         Environment: Any
>            Reporter: Dave Robinson
>            Priority: Minor
>
> If you are using the component generator (MyFacesComponentGenerator.java) then you could end up with an invalid generated java file attribute name when converting a property that has as an allowed value of "-1". 
> For example, having property 'size' with allowed values of "-1 0 1" results in 2 ok properties for 0 and 1:
> private String size0;
> private String size1;
> but an invalid definition of:
> private String size-1;
> A good solution would be to look for a leading nonA-Z, non0-9 character and replacing it with a valid character.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (TRINIDAD-1587) maven-faces-plugin should allow java compatible variable names when converting list value of "-1"

Posted by "Andrew Robinson (JIRA)" <de...@myfaces.apache.org>.
     [ https://issues.apache.org/jira/browse/TRINIDAD-1587?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrew Robinson resolved TRINIDAD-1587.
---------------------------------------

       Resolution: Fixed
    Fix Version/s:  1.2.11-plugins 
         Assignee: Andrew Robinson

Fixed in 1.2.11

Changed the getConstantNameFromProperty function so that it converts non-alphanumeric characters to underscores

> maven-faces-plugin should allow java compatible variable names when converting list value of  "-1"
> --------------------------------------------------------------------------------------------------
>
>                 Key: TRINIDAD-1587
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1587
>             Project: MyFaces Trinidad
>          Issue Type: Bug
>         Environment: Any
>            Reporter: Dave Robinson
>            Assignee: Andrew Robinson
>            Priority: Minor
>             Fix For:  1.2.11-plugins 
>
>
> If you are using the component generator (MyFacesComponentGenerator.java) then you could end up with an invalid generated java file attribute name when converting a property that has as an allowed value of "-1". 
> For example, having property 'size' with allowed values of "-1 0 1" results in 2 ok properties for 0 and 1:
> private String size0;
> private String size1;
> but an invalid definition of:
> private String size-1;
> A good solution would be to look for a leading nonA-Z, non0-9 character and replacing it with a valid character.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.