Avoid SQL Server JDBC driver to load ANTLR parsers #27343
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In particular we need it to avoid loading ANTLR classes because it's using versions which are not aligned with our BOM.
Alternatively we could have pursued alignment, but it would need ongoing maintenance and ANTLR is being used by multiple significant projects.
When such a class is loaded, ANTLR detects the misalignment (even in a micro version) and needs to throw a fatal exception; we don't actually never need this parser, but it's dangerously initialized by the native image compiler.
N.B. it might look as if an integration test is missing, but that is why I included a
@Delete
directive forSQLServerLexer
: it proofs that it is no longer reachable. The compilation would fail otherwise, if the other rules weren't doing what they are supposed to do. So we also have a regression test.