Derby
  1. Derby
  2. DERBY-5331

Incorrect use of CharsetEncoder in DDMWriter

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 10.4.1.3, 10.4.2.0, 10.5.1.1, 10.5.2.0, 10.5.3.0, 10.6.1.0, 10.6.2.1, 10.7.1.1, 10.8.1.2
    • Fix Version/s: 10.8.2.2, 10.9.1.0
    • Component/s: Network Server
    • Labels:
      None

      Description

      DDMWriter has two calls to CharsetEncoder.encode(), in writeLDString() and writeString(). According to the javadoc for CharsetEncoder, one should call reset() before one calls encode(), and flush() after on. DDMWriter doesn't call reset() or flush(). I'm not aware of any problems that happen because of it, but we should follow the spec to avoid surprises.

      1. reset-flush.diff
        1 kB
        Knut Anders Hatlen

        Issue Links

          Activity

          Hide
          Knut Anders Hatlen added a comment -

          Attached a patch that adds a call to reset() before encode(), and also a call to flush() if the encode() operation successfully encoded all characters in the input.

          Running regression tests now.

          Show
          Knut Anders Hatlen added a comment - Attached a patch that adds a call to reset() before encode(), and also a call to flush() if the encode() operation successfully encoded all characters in the input. Running regression tests now.
          Hide
          Knut Anders Hatlen added a comment -

          All the regression tests passed.

          Show
          Knut Anders Hatlen added a comment - All the regression tests passed.
          Hide
          Knut Anders Hatlen added a comment -

          Committed revision 1148658.

          Show
          Knut Anders Hatlen added a comment - Committed revision 1148658.
          Hide
          Knut Anders Hatlen added a comment -

          Merged fix to 10.8 and committed revision 1148668.

          Show
          Knut Anders Hatlen added a comment - Merged fix to 10.8 and committed revision 1148668.

            People

            • Assignee:
              Knut Anders Hatlen
              Reporter:
              Knut Anders Hatlen
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development