Uploaded image for project: 'Synapse'
  1. Synapse
  2. SYNAPSE-218

TextFileDataSource violates OMDataSource contract

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • NIGHTLY
    • 1.2
    • Core
    • None

    Description

      TextFileDataSource is an implementation of OMDataSource representing text wrapped inside a <text> element. However, it doesn't respect the contract of OMDataSource:

      1) serialize(OutputStream, OMOutputFormat) doesn't output the <text> wrapper element (actually the code is commented out) and doesn't take into account the character encoding specified by the OMOutputFormat.
      2) serialize(Writer, OMOutputFormat) only outputs an empty <text> element.
      3) TextFileDataSource will give unexpected results with multiple invocations (of the same or different methods) on the same instance, because the invocation of any of the methods consumes the InputStream.

      It should be noted that

      • VFSTransportSender relies on the behavior described in point 1;
      • the intention of the behavior described in point 2 is probably to avoid dumping the entire text data when the message is logged.

      However, the described behavior might lead to unexpected results in other situations.

      Attachments

        Activity

          People

            veithen Andreas Veithen
            veithen Andreas Veithen
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: