Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4429568

DataInputStream.readLong not threadsafe unlike its other functions

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.3.0
    • core-libs
    • generic
    • generic



      Name: ssT124754 Date: 03/23/2001


      java version "1.3.0"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
      Java HotSpot(TM) Server VM (build 2.0fcs-E, mixed mode)

      The 'readLong' function in 'DataInputStream' calls 'readInt' on 'this', instead
      of on its 'in' local variable like all the other member functions do.

      I presume all the member functions do this in case the wrapped InputStream gets
      changed in between the different function calls (could be done in a derived
      class?).

      In any case it ought to be consistent: either they all use a local variable or
      none should.
      (Review ID: 119363)
      ======================================================================

            iris Iris Clark
            ssultanasunw Shaheen Sultana (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: