You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Dawid Weiss (JIRA)" <ji...@apache.org> on 2013/01/16 09:24:13 UTC

[jira] [Resolved] (SOLR-4288) Improve logging for FileDataSource (basePath, relative resources).

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

Dawid Weiss resolved SOLR-4288.
-------------------------------

    Resolution: Fixed
    
> Improve logging for FileDataSource (basePath, relative    resources).
> ---------------------------------------------------------------------
>
>                 Key: SOLR-4288
>                 URL: https://issues.apache.org/jira/browse/SOLR-4288
>             Project: Solr
>          Issue Type: Bug
>    Affects Versions: 4.0
>            Reporter: Dawid Weiss
>            Assignee: Dawid Weiss
>            Priority: Minor
>             Fix For: 4.1, 5.0
>
>         Attachments: SOLR-4288.patch
>
>
> In fact, the logic is broken:
> {code}
>       if (!file.isAbsolute())
>         file = new File(basePath + query);
> {code}
> because basePath is null so 'null' is concatenated with the query string (path) resulting in an invalid path. 
> It should be checked if basePath is null, if so default to "."? Then resolve relative location as:
> {code}
> new File(basePathFile, query);
> {code}
> I'd also say change the log so that the absolute path is also logged in the warning message, otherwise it's really hard to figure out what's going on.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org