RFR: 8353757: Log class should have a proper clear() method [v3]

Maurizio Cimadamore mcimadamore at openjdk.org
Mon Apr 7 21:23:12 UTC 2025


On Mon, 7 Apr 2025 14:39:53 GMT, Archie Cobbs <acobbs at openjdk.org> wrote:

>> This is a simple refactoring to add a method `Log.clear()`, move `ReusableLog.clear()`'s clearing operations into it and invoke `super.clear()` instead, and add two more fields that should be included in the clear operation but were not because they were added to `Log` after `ReusableLog.clear()` was added and were missed.
>> 
>> A natural question: Are there any other fields in `Log` that should be cleared in `Log.clear()`? The two I've added (`nsuppressederrors` and `nsuppressedwarns`) are the only two that weren't there when `ReusableLog` as added, so presumably not, but it's possible.
>
> Archie Cobbs has updated the pull request incrementally with two additional commits since the last revision:
> 
>  - Reset the DiagnosticHandler stack in clear().
>  - Revert accidentally included unrelated changes.

Looks good!

-------------

Marked as reviewed by mcimadamore (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/24460#pullrequestreview-2748140624


More information about the compiler-dev mailing list