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/01/02 17:42:46 UTC

[jira] Resolved: (WICKET-3300) Redundant test in MountedMapper

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

Martin Grigorov resolved WICKET-3300.
-------------------------------------

       Resolution: Fixed
    Fix Version/s: 1.5-M4

Improved with r1054428.
Thanks.

> Redundant test in MountedMapper
> -------------------------------
>
>                 Key: WICKET-3300
>                 URL: https://issues.apache.org/jira/browse/WICKET-3300
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>            Reporter: Willis Blackburn
>            Assignee: Martin Grigorov
>            Priority: Trivial
>             Fix For: 1.5-M4
>
>
> In MountedMapper I see:
> 		// check if the URL is long enough and starts with the proper segments
> 		else if (url.getSegments().size() >= mountSegments.length &&
> 			urlStartsWith(url, mountSegments))
> but the urlStartsWith method has:
> 		if (url.getSegments().size() < segments.length)
> and returns false if that check fails, so you can skip the check before calling urlStartsWith.  Which makes sense--a URL can't "start with" some prefix if its shorter than the prefix.

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