RFR: 8359497: IllegalArgumentException thrown by SourceCodeAnalysisImpl.highlights()
Jan Lahoda
jlahoda at openjdk.org
Wed Jul 23 15:01:08 UTC 2025
When JShell computes highlights, it uses the javac' lexer to detect keywords. But, if there's a lexical error in the input, the lexer will try to report an error, but that will with an exception, as there's no input file set. This PR:
- sets a source to `Log` so that the attempt to report the error will not fail
- sets a `DiagnosticListener` so that the error is ignored (as the error is not important, this lexer is only used to detect keyword).
-------------
Commit messages:
- Cleanup.
- 8359497: IllegalArgumentException thrown by SourceCodeAnalysisImpl.highlights()
Changes: https://git.openjdk.org/jdk/pull/26446/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=26446&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8359497
Stats: 13 lines in 2 files changed: 11 ins; 0 del; 2 mod
Patch: https://git.openjdk.org/jdk/pull/26446.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/26446/head:pull/26446
PR: https://git.openjdk.org/jdk/pull/26446
More information about the compiler-dev
mailing list