Skip to content

HiddenFileFilter behaviour doesn't match its description #22

@jroper

Description

@jroper

See

/** A [[FileFilter]] that selects files that are hidden according to `java.io.File.isHidden` or if they start with a dot (`.`). */

The comment there is:

A [[FileFilter]] that selects files that are hidden according to java.io.File.isHidden or if they start with a dot (.).

That sounds like reasonable behaviour for the filter, but the implementation doesn't match that at all, it selects files that are hidden AND whose names aren't EQUAL to .. It needs to be changed to OR and startsWith dot to match.

Obviously the implementation has a bug, but the fix I think is less obvious - not excluding files that start with a dot probably hasn't caused anyone any issues, otherwise this issue would be reported and fixed. The question is, how many builds will break if the behaviour is changed to exclude files that start with a dot? I wouldn't be surprised if some builds do break.

So the question is, should the behaviour be updated to match the description, or should the description be modified to match the behaviour (and the check for the file name being equal to . be removed altogether)?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions