[jboss-jira] [JBoss JIRA] (AS7-6431) Incorrectly evaluated expression when property is defined after the expression in xml

Ondřej Chaloupka (JIRA) jira-events at lists.jboss.org
Fri Feb 1 07:16:51 EST 2013


    [ https://issues.jboss.org/browse/AS7-6431?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12751791#comment-12751791 ] 

Ondřej Chaloupka commented on AS7-6431:
---------------------------------------

As workaround it could be used run :reload operation. Then the expression is evaluated correctly. 

The same problem occurs for redefinition of value.
{code}
 <system-properties>
   <property name="qa.test.exp" value="expression.value"/>
   <property name="qa.test.property" value="${qa.test.exp:defaultValue}"/>
 </system-properties>
{code}
and run:
{code}
/system-property=qa.test.exp:write-attribute(name=value, value=something.else)
{code}

Then the 
{code}
:resolve-expression(expression="${qa.test.property}"
{code}
is evaluated as "expression.value" and not as "something.else"

The reload helps again. Maybe put info to user that reload is needed?


Still I think that necessity of defining properties in exact order is not much user friendly. Not sure about this.
                
> Incorrectly evaluated expression when property is defined after the expression in xml
> -------------------------------------------------------------------------------------
>
>                 Key: AS7-6431
>                 URL: https://issues.jboss.org/browse/AS7-6431
>             Project: Application Server 7
>          Issue Type: Bug
>          Components: Domain Management
>    Affects Versions: 7.2.0.Alpha1
>            Reporter: Ondřej Chaloupka
>            Assignee: Brian Stansberry
>
> There is problem in evaluation of expression in case that property for evaluation is defined after the expression.
> In case of using DMR the order of property and expression definition is not taken in consideration and substitution works fine.
> When you define system properties in xml like:
> {code}
>     <system-properties>
>         <property name="qa.test.property" value="${qa.test.exp:defaultValue}"/>
>         <property name="qa.test.exp" value="expression.value"/>
>     </system-properties>
> {code}
> you start the container and then you can check the expression evaluation in jboss-cli.sh with command:
> {code}
> :resolve-expression(expression="${qa.test.property}")
> {code}
> The expression will be evaluated as "defaultValue" what is not correct because the "qa.test.exp" is defined.
> When you switch definitions of properties (switch <property> tags) then the expression will be evaluated correctly (as "expression.value).

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira



More information about the jboss-jira mailing list