You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Antti S. Lankila (JIRA)" <ji...@apache.org> on 2011/07/03 13:28:21 UTC
[jira] [Created] (WICKET-3862) ComponentInfo: simplified -, :
encoding procedure
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
Priority: Minor
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
[jira] [Resolved] (WICKET-3862) ComponentInfo: simplified -, :
encoding procedure
Posted by "Martin Grigorov (JIRA)" <ji...@apache.org>.
[ 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
[jira] [Assigned] (WICKET-3862) ComponentInfo: simplified -, :
encoding procedure
Posted by "Martin Grigorov (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-3862?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Martin Grigorov reassigned WICKET-3862:
---------------------------------------
Assignee: Martin Grigorov
> 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
> 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
[jira] [Commented] (WICKET-3862) ComponentInfo: simplified -, :
encoding procedure
Posted by "Martin Grigorov (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-3862?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13059184#comment-13059184 ]
Martin Grigorov commented on WICKET-3862:
-----------------------------------------
Looks OK.
Actually it uses StringBuffer, not Builder. It'd be nice if Oracle improve the methods to accept Appendable instead of StringBuffer.
> 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
> Priority: Minor
> 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
[jira] [Updated] (WICKET-3862) ComponentInfo: simplified -, :
encoding procedure
Posted by "Antti S. Lankila (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-3862?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Antti S. Lankila updated WICKET-3862:
-------------------------------------
Attachment: simplified-componentinfo.diff
Use Pattern, Matcher and StringBuilder to perform single-pass simultaneous replacement of two distinct values.
> 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
> Priority: Minor
> 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