Commons Sandbox
  1. Commons Sandbox
  2. SANDBOX-154

[io] FileFinder.find() doesn't work correctly with Finder.TIME option

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Finder
    • Labels:
      None
    • Environment:

      Operating System: Windows 2000
      Platform: All

      Description

      FileFinder.find(File file, Map option) doesn't work correctly if options
      contains a Finder.TIME with a value greater than 24.

      The error is in FindingFilter.TimeFilter.accept(File file):

      In the expression

      file.lastModified() > System.currentTimeMillis() - this.argument * 60000*60*24

      the part 'this.argument * 60000*60*24' is evaluated in the integer value range
      which is exhausted if this.argument > 24

      Fix: use 'this.argument * 60000L * 60L * 24L'

        Activity

        Hide
        Stephen Colebourne added a comment -

        Change made, although this class is now in a branch as is not scheduled for release.

        Show
        Stephen Colebourne added a comment - Change made, although this class is now in a branch as is not scheduled for release.

          People

          • Assignee:
            Unassigned
            Reporter:
            Martin Kompf
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development