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.
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.
- duplicates
-
JDK-7164841 Improvements to the GC log file rotation
- Closed