forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ross Gardler (JIRA)" <j...@apache.org>
Subject [jira] Closed: (FOR-526) "exists" selector tests true when unresolvable locationmap hint is passed
Date Fri, 10 Jun 2005 13:06:46 GMT
     [ http://issues.apache.org/jira/browse/FOR-526?page=all ]
     
Ross Gardler closed FOR-526:
----------------------------

    Resolution: Fixed
     Assign To: Ross Gardler

Applied with minor modifications (moved outside try block and used braces around if as per
code convent of rest of file)

> "exists" selector tests true when unresolvable locationmap hint is passed
> -------------------------------------------------------------------------
>
>          Key: FOR-526
>          URL: http://issues.apache.org/jira/browse/FOR-526
>      Project: Forrest
>         Type: Bug
>   Components: Core operations
>     Versions: 0.7-dev
>  Environment: 0.7 locationmap branch
>     Reporter: Tim Williams
>     Assignee: Ross Gardler
>     Priority: Minor

>
> As described in the bottom mails on this thread:
> http://marc.theaimsgroup.com/?t=111793036600001&r=1&w=2
> Essentially, when a {lm:var} is passed to the test of an exists selector, if the locationmap
"hint" doesn't exist in locationmap.xml, then LocationMapModule is properly resolving to null
but the SourceExistsSelector resolves the URI to "$FORREST_HOME/main/webapp/".  A workaround
is to put a null and empty string test in SourceExistsSelector.select() before the call to
resolveURI().  This may very well be a bug outside of Forrest since the LocationMapModule
is properly resolving non-existent hints to null.  
> --tim
> Here's the patch for the workaround.
> Index: SourceExistsSelector.java
> ===================================================================
> --- SourceExistsSelector.java	(revision 188836)
> +++ SourceExistsSelector.java	(working copy)
> @@ -76,6 +76,10 @@
>      public boolean select(String uri, Map objectModel, Parameters parameters) {
>          Source src = null;
>          try {
> +        
> +        		if (uri == null || uri == "")
> +					return false;
> +					
>              src = resolver.resolveURI(uri);
>              if (src.exists()) {
>                  return true;

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Mime
View raw message