In JDK-8345263, a new method Lint.logIfEnabled(Log log, DiagnosticPosition pos, LintWarning warning) was added.
For simplicity, and to avoid possible initialization ordering issues, it was decided at the time to pass a "log" parameter explicitly instead of having Lint keep its own reference to the Log singleton.
After some other recent changes (JDK-8344079, JDK-8347474) the initialization ordering issues have been alleviated. So the "log" parameter can be removed and Lint can just keep its own reference.
Code inspection reveals that there is only ever one Log instance per Context, so it's not possible for the "log" to be wrong in doing this. This was also verified by adding an assertion check and running the compiler test suite.
For simplicity, and to avoid possible initialization ordering issues, it was decided at the time to pass a "log" parameter explicitly instead of having Lint keep its own reference to the Log singleton.
After some other recent changes (
Code inspection reveals that there is only ever one Log instance per Context, so it's not possible for the "log" to be wrong in doing this. This was also verified by adding an assertion check and running the compiler test suite.
- links to
-
Commit(master) openjdk/jdk/89e5e7ab
-
Review(master) openjdk/jdk/23400