Uploaded image for project: 'Commons Sandbox'
  1. Commons Sandbox
  2. SANDBOX-154

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • None
    • Finder
    • None
    • Operating System: Windows 2000
      Platform: All

    • 34601

    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'

      Attachments

        Activity

          People

            Unassigned Unassigned
            mkompf@gmx.net Martin Kompf
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: