[jboss-jira] [JBoss JIRA] (WFLY-6239) CLI: failure when adding a JNDI entry with default value containing a '$' at the end

Valentin Maechler (JIRA) issues at jboss.org
Thu Feb 18 02:57:00 EST 2016


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

Valentin Maechler edited comment on WFLY-6239 at 2/18/16 2:56 AM:
------------------------------------------------------------------

Just had a look at the sources...
Bug in: [ExpressionResolverImpl.java|https://github.com/wildfly/wildfly-core/blob/master/controller/src/main/java/org/jboss/as/controller/ExpressionResolverImpl.java]

Just add the following method to its JUnit test class [ExpressionResolverUnitTestCase.java|https://github.com/wildfly/wildfly-core/blob/master/controller/src/test/java/org/jboss/as/controller/ExpressionResolverUnitTestCase.java] to reproduce the issue:
{code}
@Test
public void myTest() throws OperationFailedException {
    System.setProperty("test.prop.blabla", "system-prop-value");
    try {
        ModelNode node = new ModelNode();
        node.get("expr").set(new ValueExpression("${test.prop.blabla:a$}"));

        node = ExpressionResolver.TEST_RESOLVER.resolveExpressions(node);

        assertEquals(1, node.keys().size());
        assertEquals("system-prop-value", node.get("expr").asString());
    } finally {
        System.clearProperty("test.prop.blabla");
    }
}
{code}


was (Author: vmae):
Just had a look at the sources...
Bug in: [ExpressionResolverImpl.java|https://github.com/wildfly/wildfly-core/blob/master/controller/src/main/java/org/jboss/as/controller/ExpressionResolverImpl.java]

Just add the following method to its JUnit test class [ExpressionResolverUnitTestCase.javahttps://github.com/wildfly/wildfly-core/blob/master/controller/src/test/java/org/jboss/as/controller/ExpressionResolverUnitTestCase.java] to reproduce the issue:
{code}
@Test
public void myTest() throws OperationFailedException {
    System.setProperty("test.prop.blabla", "system-prop-value");
    try {
        ModelNode node = new ModelNode();
        node.get("expr").set(new ValueExpression("${test.prop.blabla:a$}"));

        node = ExpressionResolver.TEST_RESOLVER.resolveExpressions(node);

        assertEquals(1, node.keys().size());
        assertEquals("system-prop-value", node.get("expr").asString());
    } finally {
        System.clearProperty("test.prop.blabla");
    }
}
{code}

> CLI: failure when adding a JNDI entry with default value containing a '$' at the end
> ------------------------------------------------------------------------------------
>
>                 Key: WFLY-6239
>                 URL: https://issues.jboss.org/browse/WFLY-6239
>             Project: WildFly
>          Issue Type: Bug
>          Components: CLI
>    Affects Versions: 10.0.0.Final
>            Reporter: Valentin Maechler
>            Assignee: Alexey Loubyansky
>
> Can not add a JNDI / naming entry which contains a "$" sign at the end of its default value.
> e.g. {code}
> value="${my.sample.property1:entry5-default-value-with-special-char-at-the-end-$}"
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.11#64026)


More information about the jboss-jira mailing list