Uploaded image for project: 'Mahout'
  1. Mahout
  2. MAHOUT-175

Use IOUtils, FileLineIterable/Iterator across the project

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 0.2
    • 0.2
    • None
    • None

    Description

      The patch I will attach does a couple things:

      Uses FileLineIterable/Iterator for iterating over lines of a file. This is slightly tidier, but also addresses a few subtle issues across the code base, where reading of files did not always end by closing the stream, or, relied on platform default character encoding.

      Uses IOUtils consistently to close Closeables, swallowing and logging exceptions in cases where they are not to be treated as errors.

      Finally, fixes some issues in ARFFIterator while I'm at it – hasNext() changes state, when next() should, and next() did not throw NoSuchElementException

      Attachments

        1. MAHOUT-175.patch
          55 kB
          Sean R. Owen

        Activity

          People

            srowen Sean R. Owen
            srowen Sean R. Owen
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: