You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Martin Grigorov (JIRA)" <ji...@apache.org> on 2011/07/03 13:58:22 UTC

[jira] [Resolved] (WICKET-3862) ComponentInfo: simplified -, : encoding procedure

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

Martin Grigorov resolved WICKET-3862.
-------------------------------------

       Resolution: Fixed
    Fix Version/s: 1.5-RC6

Simplified it by using simple charsequence traversal.
This is 3x faster than before and still simpler than Regex based solution as in the suggested patch.

> ComponentInfo: simplified -, : encoding procedure
> -------------------------------------------------
>
>                 Key: WICKET-3862
>                 URL: https://issues.apache.org/jira/browse/WICKET-3862
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-core
>            Reporter: Antti S. Lankila
>            Assignee: Martin Grigorov
>            Priority: Minor
>             Fix For: 1.5-RC6
>
>         Attachments: simplified-componentinfo.diff
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> ComponentInfo encodes the interface and path of the component by generating dash-separated values such as listener-foo-bar--baz, which means interface "listener", component path "foo:bar-baz". The path encoding is pretty clumsy and involves three full substitutions using Strings.replaceAll():
> 1. - => temporary string
> 2. : => -
> 3. temporary string => --
> The reverse procedure does the same steps in reverse to cancel the transformation.
> This patch appended handles the steps simultaneously by using a regex substitution method which matches both : and - and replaces by - and -- respectively, and the reverse method matches -- or - (with -- preferred) and replaces by - and : respectively. It should be more elegant and doesn't require generating a rather kooky [[[[[[WICKET]]TMP]]DASH0.123456789E]]]] type random constant.
> Additionally I had a wicket-using website somehow fail in production after an update because somehow it would no longer correctly decode the mangled names' -- back to -, but rather attempted to resolve one of those [[[[[[WICKET]]TMP]]DASH]]etc]]]] names. I admit I am confused about how exactly this came to be, but somehow it did.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira