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

LineReader to implement AutoCloseable

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.7
    • 2.9.0
    • Utilities
    • None

    Description

      org.apache.commons.io.LineReader should implement the AutoCloseable interface in order to allow the use of try-with-resources statement such as in the following example:

      try (final LineIterator itr = new LineIterator(new FileReader("c:/temp/readme.txt"))) {
        while (itr.hasNext()) {
          System.out.println(itr.next());
          }
      }

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            andrear Andrea Rombaldi
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 5m
                5m
                Remaining:
                Remaining Estimate - 5m
                5m
                Logged:
                Time Spent - Not Specified
                Not Specified