Uploaded image for project: 'Commons IO'
  1. Commons IO
  2. IO-442

Javadoc contradictory for FileFilterUtils.ageFileFilter(cutoff) and the filter it constructs: AgeFileFilter(cutoff)

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: 2.4
    • Fix Version/s: 2.6
    • Component/s: Filters
    • Labels:
      None

      Description

      Documentation states that it returns true if the file is after cutoff... but the code does opposite!

          /**
           * Returns a filter that returns true if the file was last modified after
           * the specified cutoff time.
           */
      

      BUT..the code constructs the following:

          public static IOFileFilter ageFileFilter(long cutoff) {
              return new AgeFileFilter(cutoff);
          }
      

      And the Javadoc for this AgeFileFilter says...OLDER i.e. before

          /**
           * Constructs a new age file filter for files equal to or older than
           * a certain cutoff
           *
           * @param cutoff  the threshold age of the files
           */
      

      Which is it?!

        Attachments

          Activity

            People

            • Assignee:
              pascalschumacher Pascal Schumacher
              Reporter:
              roninsos Simon Robinson
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: