Title: test: fail the build when TablesNamesFinder misses a visitor dispatch method by fudianchn · Pull Request #2538 · JSQLParser/JSqlParser · GitHub
Open Graph Title: test: fail the build when TablesNamesFinder misses a visitor dispatch method by fudianchn · Pull Request #2538 · JSQLParser/JSqlParser
X Title: test: fail the build when TablesNamesFinder misses a visitor dispatch method by fudianchn · Pull Request #2538 · JSQLParser/JSqlParser
Description: AI disclosure: this change was prepared with AI coding agents, reviewed and revised line by line by me.
What
Adds TablesNamesFinderCompletenessTest: it fails the build when a visitor interface declared by TablesNamesFinder gains a dispatch method visit(Node, context) that is not implemented in the TablesNamesFinder class hierarchy (it resolves to an interface default instead).
Why
TablesNamesFinder dispatches through 8 visitor interfaces. Most visit(Node, context) methods are abstract, so a missing implementation fails compilation. But the interfaces progressively gain default methods (SelectVisitor#visit(PivotQuery, context) returns null, ExpressionVisitor#visit(GroupByElement, context) traverses), and for a default declared by a single interface a missing implementation compiles silently and loses the tables of that node type without any test failing.
Demonstrated on master by mutation: turning StatementVisitor#visit(Analyze, context) into a return null default and dropping the finder override compiles, keeps the whole test suite green (no existing test collects tables from ANALYZE), and findTables("ANALYZE mytab") silently returns [].
After #2479 and #2517 the finder implements all 214 dispatch methods; this test pins that state for the interfaces it declares.
How
Enumerates the declared visitor interfaces and their visit(Node, context) methods by reflection and asserts each resolves to an implementation in the TablesNamesFinder class hierarchy (not to an interface default); interfaces declared later are covered automatically.
Dispatch helpers carrying a java.util collection (e.g. MergeOperationVisitor#visit(Collection
Open Graph Description: AI disclosure: this change was prepared with AI coding agents, reviewed and revised line by line by me. What Adds TablesNamesFinderCompletenessTest: it fails the build when a visitor interface decl...
X Description: AI disclosure: this change was prepared with AI coding agents, reviewed and revised line by line by me. What Adds TablesNamesFinderCompletenessTest: it fails the build when a visitor interface decl...
Opengraph URL: https://github.com/JSQLParser/JSqlParser/pull/2538
X: @github
Domain: github.com
IPv4 address: 140.82.112.4
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:7d9e0d1e-5912-ca1a-2042-258fe1f06556 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | AB14:32A711:446928:5E39CF:6B049D6D |
| html-safe-nonce | fc5b87660425a9bbd434996d8e3b6d6fc36e6674ae80df523dcb15440036d7e8 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQjE0OjMyQTcxMTo0NDY5Mjg6NUUzOUNGOjZCMDQ5RDZEIiwidmlzaXRvcl9pZCI6IjU5ODY3NzEwNDc1ODcwMjgzMzMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 6b9561dcc5d77436ea2f019febfad31bab084efff00acc38fdcf585b4c6bb137 |
| hovercard-subject-tag | pull_request:4432962801 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/JSQLParser/JSqlParser/pull/2538/files |
| twitter:image | https://avatars.githubusercontent.com/u/40510713?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/40510713?s=400&v=4 |
| og:image:alt | AI disclosure: this change was prepared with AI coding agents, reviewed and revised line by line by me. What Adds TablesNamesFinderCompletenessTest: it fails the build when a visitor interface decl... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9784b6f42e2d5eac4e394fa88cad134c0dc5b6662b4ff2787a1ed1ef5a96331d |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/JSQLParser/JSqlParser git https://github.com/JSQLParser/JSqlParser.git |
| octolytics-dimension-user_id | 4643847 |
| octolytics-dimension-user_login | JSQLParser |
| octolytics-dimension-repository_id | 1944709 |
| octolytics-dimension-repository_nwo | JSQLParser/JSqlParser |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1944709 |
| octolytics-dimension-repository_network_root_nwo | JSQLParser/JSqlParser |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 3fd14143b75b2af7b76bbd23b069867d091adfcc |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | no-cache |
Viewport: width=device-width