Uploaded image for project: 'JBoss Transaction Manager'
  1. JBoss Transaction Manager
  2. JBTM-3262

improve string serialization

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Minor
    • 5.10.5.Final
    • 5.10.3.Final
    • Transaction Core
    • None

    Description

      Core's handling of unicode string packing is, not to put too fine a point on it, wrong.

      OutputBuffer's packString(String s) assumes the serialized form of a UTF-8 string has the same number of bytes as the String has code units, which is incorrect for any String containing multi-byte code units.

      Since that needs fixing anyhow, the refactoring pulls out the byte[] packing to a separate function from the String encoding, additionally enabling a performance optimization:

      Where a fixed String is packed frequently, the transformation to byte[] can be done once and cached, eliding memory allocation and processing on subsequent invocations. This is particularly useful for the StateManager marker, which is packed to buffers with great frequency.

      Attachments

        Activity

          People

            rhn-engineering-jhallida Jonathan Halliday
            rhn-engineering-jhallida Jonathan Halliday
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: