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

rotatingFileStream needs a cleanup

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Duplicate
    • Icon: P4 P4
    • 9
    • 9
    • hotspot

      There are a few different things in rotatingFileStream that needs a closer look and some cleanup.

      1. The class has two constructors, but only one of them is used. They are identical except for a minor detail and this code duplication should be removed.

      2. The class has it's own counter, _bytesWritten, instead of using the inherited counters for position. The inherited counters are updated, but it's not clear if this is done in a correct way as they are updated even though nothing is written to the log file (if file==NULL).

      3. Some external code is looking at the inherited counters in their logic. Since these counters are not updated and reset properly it is not clear what happens if the counters wrap and report zero to the external logic.

            jwilhelm Jesper Wilhelmsson
            jwilhelm Jesper Wilhelmsson
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: