You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Pedro Santos (JIRA)" <ji...@apache.org> on 2016/09/22 04:29:20 UTC
[jira] [Updated] (WICKET-6247) Expression property fails if a may
key contains the '[' character
[ https://issues.apache.org/jira/browse/WICKET-6247?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Pedro Santos updated WICKET-6247:
---------------------------------
Description:
An expression property having a '[' character like "bean.map[code[foo]" will fail because PropertyResolver replaces all '[' charaters by '.['
A possible test to show the problem:
PropertyResolverTest{
...
@Test
public void shouldAllowMapKeysWithSpecialCharacters() throws Exception
{
String code = "[!@#$%^&*()_+-=[{}|]";
String expression = "[" + code + "]";
Map<String, Integer> integerMap = new HashMap<String, Integer>();
PropertyResolver.setValue(expression, integerMap, AN_INTEGER, CONVERTER);
assertThat(PropertyResolver.getValue(expression, integerMap), is(AN_INTEGER));
assertThat(integerMap.get(code), is(AN_INTEGER));
}
...
}
was:
An expression property having a '[' character like "bean.map[code[foo]" will fail because PropertyResolver replaces all '[' charaters by '.['
A possible test to show the problem:
PropertyResolverTest{
...
@Test
public void shouldAllowMapKeysWithSpecialCharacters() throws Exception
{
String expression = "[!@#$%^&*()_+-=[{}|]";
PropertyResolver.setValue(expression, map, AN_INTEGER, CONVERTER);
assertThat(PropertyResolver.getValue(expression, map), is(AN_INTEGER));
assertThat(map.get(expression), is(AN_INTEGER));
}
...
}
> Expression property fails if a may key contains the '[' character
> -----------------------------------------------------------------
>
> Key: WICKET-6247
> URL: https://issues.apache.org/jira/browse/WICKET-6247
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Affects Versions: 8.0.0-M1, 7.4.0, 6.24.0
> Reporter: Pedro Santos
> Assignee: Pedro Santos
>
> An expression property having a '[' character like "bean.map[code[foo]" will fail because PropertyResolver replaces all '[' charaters by '.['
> A possible test to show the problem:
> PropertyResolverTest{
> ...
> @Test
> public void shouldAllowMapKeysWithSpecialCharacters() throws Exception
> {
> String code = "[!@#$%^&*()_+-=[{}|]";
> String expression = "[" + code + "]";
> Map<String, Integer> integerMap = new HashMap<String, Integer>();
> PropertyResolver.setValue(expression, integerMap, AN_INTEGER, CONVERTER);
> assertThat(PropertyResolver.getValue(expression, integerMap), is(AN_INTEGER));
> assertThat(integerMap.get(code), is(AN_INTEGER));
> }
> ...
> }
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)