RFR: 8224228: No way to locally suppress lint warnings in parser/tokenizer or preview features [v2]

Archie Cobbs acobbs at openjdk.org
Thu Jan 23 22:57:27 UTC 2025


> This PR updates the `DeferredLintHandler` so that deferred warnings can be registered during parsing, before any `JCTree` nodes have been created, and it uses this new capability to update the `"preview"` and `"text-blocks"` Lint warnings so that they can be suppressed via `@SuppressWarnings` annotations. More details are provided in additional comments.

Archie Cobbs has updated the pull request incrementally with five additional commits since the last revision:

 - Remove Attr.flushDeferredLintHandler() which doesn't appear necessary.
 - Merge branch 'JDK-8348427' into JDK-8224228
 - Refactor the DeferredLintHandler API to maintain the "stack" itself.
 - Add Javadoc to document a subtley in the API.
 - Update DeferredLintHandler API to use JCTree instead of DiagnosticPosition.

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/23237/files
  - new: https://git.openjdk.org/jdk/pull/23237/files/25097710..877b16c2

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=23237&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=23237&range=00-01

  Stats: 47 lines in 3 files changed: 15 ins; 30 del; 2 mod
  Patch: https://git.openjdk.org/jdk/pull/23237.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/23237/head:pull/23237

PR: https://git.openjdk.org/jdk/pull/23237


More information about the compiler-dev mailing list