Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Trivial Trivial
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.2, 4.0-ALPHA
    • Component/s: core/store
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      Lucene doesn't use this method, and, FindBugs reports that FSDirectory's impl shouldn't swallow the returned result from File.setLastModified.

      1. LUCENE-2027.patch
        8 kB
        Michael McCandless

        Activity

        Hide
        Simon Willnauer added a comment -

        We talked about this yesterday night @ApacheCon. It would probably be the right thing to deprecate and introduce a new method returning a boolean. For now we where talking about throwing an IOException if setLastModified returns false. The Directory interface already has an IOException in the function signature so that would not break back compat but would yield the correct behaviour.

        simon

        Show
        Simon Willnauer added a comment - We talked about this yesterday night @ApacheCon. It would probably be the right thing to deprecate and introduce a new method returning a boolean. For now we where talking about throwing an IOException if setLastModified returns false. The Directory interface already has an IOException in the function signature so that would not break back compat but would yield the correct behaviour. simon
        Hide
        Michael McCandless added a comment -

        Why not simply deprecate and then remove the method? Nothing in Lucene uses it.

        Show
        Michael McCandless added a comment - Why not simply deprecate and then remove the method? Nothing in Lucene uses it.
        Hide
        Uwe Schindler added a comment -

        Missed this issue, from java-user:

        We discussed about this method yesterday in the evening. The abstract base
        class defines the method as throwing an IOException. So the correct
        behaviour would be to throw an IOException if setLastModified returns false
        (which happens according to the docs, if the date cannot be changed because
        of an IO/FS prob).

        Show
        Uwe Schindler added a comment - Missed this issue, from java-user: We discussed about this method yesterday in the evening. The abstract base class defines the method as throwing an IOException. So the correct behaviour would be to throw an IOException if setLastModified returns false (which happens according to the docs, if the date cannot be changed because of an IO/FS prob).
        Hide
        Michael McCandless added a comment -

        Patch, removing Dir.touchFile from trunk.

        For 3.x I'll deprecate.

        Show
        Michael McCandless added a comment - Patch, removing Dir.touchFile from trunk. For 3.x I'll deprecate.
        Hide
        Robert Muir added a comment -

        Bulk closing for 3.2

        Show
        Robert Muir added a comment - Bulk closing for 3.2

          People

          • Assignee:
            Michael McCandless
            Reporter:
            Michael McCandless
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development