[ 
https://issues.apache.org/jira/browse/WICKET-2919?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Igor Vaynberg resolved WICKET-2919.
-----------------------------------

         Assignee: Igor Vaynberg
    Fix Version/s: 1.5-M2
       Resolution: Fixed

1.5 will no longer allow property expressions that start with a "."

in 1.4 we leave it as is in case someone depends on this "feature"

> inconsistency in property expression when using . for self reference
> --------------------------------------------------------------------
>
>                 Key: WICKET-2919
>                 URL: https://issues.apache.org/jira/browse/WICKET-2919
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.4.9
>            Reporter: Joseph Pachod
>            Assignee: Igor Vaynberg
>            Priority: Minor
>             Fix For: 1.5-M2
>
>         Attachments: PropertyModelTest.java
>
>
> Let's consider this class :
> class Container {
>         String string = "foo";
>         List<String> strings = Arrays.asList(new String[]{"test"});
>     }
> This would work:
> new PropertyModel<String>(container, ".string").getObject()
> => returns "foo"
> but this doesn't:
> new PropertyModel<String>(container, ".strings[0]").getObject()
> it fails with
> org.apache.wicket.WicketRuntimeException: no get method defined for class: 
> class org.demo.PropertyModelTest$Container expression: strings
> Similarly, this doesn't work:
> new PropertyModel<Container>(container, ".").getObject()
> exception is :java.lang.StringIndexOutOfBoundsException: String index out of 
> range: 0
> In the end, should the dot being allowed for self reference ? It's already 
> used as the property separator, so it would be quite misleading.
> I've attached some proper junit test for these points.

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

Reply via email to