lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael McCandless (JIRA)" <>
Subject [jira] Updated: (LUCENE-1468) FSDirectory.list() is inconsistent
Date Tue, 02 Dec 2008 12:02:44 GMT


Michael McCandless updated LUCENE-1468:

    Attachment: LUCENE-1468.patch

Attached patch.  I think it's ready to commit.  I'll wait a day or

I deprecated Directory.list() in favor of the new
Directory.listAll().  listAll does no filtering, and, never returns
null (instead throws more meaningful IOExceptions).

I added a new NoSuchDirectoryException in, and
FSDirectory.listAll throws this if the directory does not exist, or if
it exists but isn't a directory, so you now get a clearer exception on
opening an IndexReader an an invalid directory.

I fixed all places in Lucene core & contrib that called list() to call
listAll() instead.  I also added test cases to make sure LUCENE-385
and LUCENE-638 remain fixed.

> FSDirectory.list() is inconsistent
> ----------------------------------
>                 Key: LUCENE-1468
>                 URL:
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 2.1, 2.2, 2.3, 2.3.1, 2.3.2, 2.4
>            Reporter: Marcel Reutegger
>            Assignee: Michael McCandless
>            Priority: Minor
>         Attachments:, LUCENE-1468.patch
> LUCENE-638 added a check to the FSDirectory.list() method to only return files that are
Lucene related. I think this change made the FSDirectory implementation inconsistent with
all other methods in Directory. E.g. you can create a file with an arbitrary name using FSDirectory,
fileExists() will report that it is there, deleteFile() will remove it, but the array returned
by list() will not contain the file.
> The actual issue that was reported in LUCENE-638 was about sub directories. Those should
clearly not be listed, but IMO it is not the responsibility of a Directory implementation
to decide what kind of files can be created or listed. The Directory class is an abstraction
of a directory and it should't to more than that.

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

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message