Uploaded image for project: 'Jalview'
  1. Jalview
  2. JAL-3939

Revisit and refactor AlignFile/FileParse input stream close/dispose semantics

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      Ideally, any low level file ops should happen in the base class (FileParse) rather than in AlignFile. AlignFile should call the FileParse.close() method rather than directly manipulate dataIn, which is managed by FileParse. Note that FileParse.close() nulls the dataIn reference so the stream can be garbage collected properly.

      It's also good practice to try to close() in a finally {} clause, catching and reporting exceptions if needed... this is actually what the FileParse.close() method's design was intended for, since the caller should have already checked 'error' and 'errormessage' for parsing problems. Exceptions/Errors on close are not fatal for file import, but could be useful to include in debug/trace logging.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jprocter James Procter
              Reporter:
              jprocter James Procter
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated: