RFR: 8344148: Add an explicit compiler phase for warning generation

Vicente Romero vromero at openjdk.org
Thu Nov 21 16:56:20 UTC 2024


On Wed, 13 Nov 2024 22:25:36 GMT, Archie Cobbs <acobbs at openjdk.org> wrote:

> Please review this patch which does some minor refactoring to the compiler:
> * Create a new `WARN` phase which can be a dedicated home for (new) lint/warning logic
> * Create a new `WarningAnalyzer` singleton whose job is to invoke such lint/warning logic
> * Move `ThisEscapeAnalyzer` out of `Flow` (where it doesn't belong) and into `WarningAnalyzer`
> * Refactor `ThisEscapeAnalyzer` to be a context singleton like all other such classes
> 
> See [JDK-8344148](https://bugs.openjdk.org/browse/JDK-8344148) for details.

src/jdk.compiler/share/classes/com/sun/tools/javac/comp/ThisEscapeAnalyzer.java line 267:

> 265:     }
> 266: 
> 267:     private void doAnalyzeTree(Env<AttrContext> env) {

the doAnalyzeTree method doesn't seems to add much value

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

PR Review Comment: https://git.openjdk.org/jdk/pull/22088#discussion_r1852514258


More information about the compiler-dev mailing list