You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Igor Vaynberg (JIRA)" <ji...@apache.org> on 2011/03/08 08:57:59 UTC
[jira] Resolved: (WICKET-3506) ResourceMapper doesn't work:
mapHandler() always returns null
[ https://issues.apache.org/jira/browse/WICKET-3506?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Igor Vaynberg resolved WICKET-3506.
-----------------------------------
Resolution: Fixed
Fix Version/s: 1.5-RC3
> ResourceMapper doesn't work: mapHandler() always returns null
> -------------------------------------------------------------
>
> Key: WICKET-3506
> URL: https://issues.apache.org/jira/browse/WICKET-3506
> Project: Wicket
> Issue Type: Bug
> Components: wicket-core
> Affects Versions: 1.5-RC2
> Reporter: Matt Brictson
> Assignee: Igor Vaynberg
> Fix For: 1.5-RC3
>
> Attachments: quickstart-WICKET-3506.tgz
>
>
> ResourceMapper#mapHandler uses the following code test whether a particular ResourceReferenceRequestHandler should be mapped:
> // see if request handler addresses the resource we serve
> if (resourceReference.getResource().equals(handler.getResource()) == false)
> {
> return null;
> }
> Unfortunately this if statement always evaluates to true and thus null is returned.
> The problem is that IResource implementations do not provide an equals() method. In practice this means that the default Object#equals() implementation is used, which nearly always results in false for the equality test.
> I see two possible solutions:
> 1. Implement equals() for all IResource classes.
> 2. Compare the ResourceReference objects instead, which already have a meaningful equals() implementation. In other words:
> // see if request handler addresses the resource we serve
> if (resourceReference.equals(handler.getResourceReference()) == false)
> {
> return null;
> }
> I'm attaching a quickstart that illustrates this bug.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira