Uploaded image for project: 'Commons IO'
  1. Commons IO
  2. IO-136

HexDump's use of static StringBuffers isn't thread-safe

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.3.2
    • 1.4
    • None
    • None

    Description

      HexDump has two private static dump() method's that alter static instances of StringBuffer:

      dump(long) modifies static StringBuffer variable _lbuffer returning _lbuffer
      dump(char) modifies static StringBuffer variable _cbuffer returning _cbuffer

      Both these methods are called by the public static dump(byte[], long, OutputStream, int) method. Multiple threads calling the public dump method at the same time could cause these StringBuffer to contain mixed up data and result in a bug.

      Attachments

        Activity

          People

            niallp Niall Pemberton
            niallp Niall Pemberton
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: