Integrated: 8349155: The "log" parameter to Lint.logIfEnabled() is not needed
Archie Cobbs
acobbs at openjdk.org
Thu Feb 6 01:55:33 UTC 2025
On Fri, 31 Jan 2025 18:11:41 GMT, Archie Cobbs <acobbs at openjdk.org> wrote:
> In [JDK-8345263](https://bugs.openjdk.org/browse/JDK-8345263), a new method `Lint.logIfEnabled(Log log, DiagnosticPosition pos, LintWarning warning)` was added. It was decided at the time to pass a `log` parameter explicitly instead of having `Lint` keep its own reference to the `Log` singleton. This was done to keep a conservative approach with the refactoring and to avoid possible initialization ordering issues.
>
> After other recent changes ([JDK-8344079](https://bugs.openjdk.org/browse/JDK-8344079), [JDK-8347474](https://bugs.openjdk.org/browse/JDK-8347474)) the initialization ordering issues have been alleviated. It's also the case that there is only ever one `Log` instance per compiler `Context`. So the `log` parameter can be removed and `Lint` can just keep its own reference, as is the normal custom in the compiler code. This results in a minor code cleanup.
This pull request has now been integrated.
Changeset: 89e5e7ab
Author: Archie Cobbs <acobbs at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/89e5e7ab73472b7d02aac5b8b0c7e9f26db6ec32
Stats: 49 lines in 8 files changed: 3 ins; 2 del; 44 mod
8349155: The "log" parameter to Lint.logIfEnabled() is not needed
Reviewed-by: mcimadamore
-------------
PR: https://git.openjdk.org/jdk/pull/23400
More information about the compiler-dev
mailing list