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

        Martin Kompf created issue -
        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.
        Henri Yandell made changes -
        Field Original Value New Value
        issue.field.bugzillaimportkey 34601 12342208
        Henri Yandell made changes -
        Component/s IO [ 12311117 ]
        Assignee Jakarta Commons Developers Mailing List [ commons-dev@jakarta.apache.org ]
        Key COM-2056 IO-7
        Project Commons [ 12310458 ] Commons IO [ 12310477 ]
        Affects Version/s Nightly Builds [ 12311648 ]
        Henri Yandell made changes -
        Affects Version/s Nightly Builds [ 12311870 ]
        Henri Yandell made changes -
        Bugzilla Id 34601
        Component/s Finder [ 12311207 ]
        Henri Yandell made changes -
        Component/s Finder [ 12311207 ]
        Key IO-7 SANDBOX-154
        Affects Version/s Nightly Builds [ 12311870 ]
        Project Commons IO [ 12310477 ] Commons Sandbox [ 12310491 ]
        Component/s Finder [ 12311267 ]
        Henri Yandell made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development