Title: Fix editable key columns after clearing legacy names by minleejae · Pull Request #2775 · JSQLParser/JSqlParser · GitHub
Open Graph Title: Fix editable key columns after clearing legacy names by minleejae · Pull Request #2775 · JSQLParser/JSqlParser
X Title: Fix editable key columns after clearing legacy names by minleejae · Pull Request #2775 · JSQLParser/JSqlParser
Description: Purpose Allow callers to clear an index or constraint's legacy column names and then repopulate its structured key list. Today key.setColumnsNames(null) followed by addColumns(...) throws UnsupportedOperationException. Current design (As-is) The shared KeyColumnSource.setColumnsNames(null) installs Collections.emptyList(). Index, primary/unique key, foreign key and exclusion constraint nodes retain that list. Their fluent appenders expect an editable list, so null-clear behaves differently from an empty-name replacement. Target design (To-be) Use an empty ArrayList in the shared null-clear path. Both null and empty name lists clear the keys and leave them editable through getColumns() and the existing addColumns overloads. The legacy accessor still returns a rendered snapshot; replacing names still creates opaque keys and discards prior element-specific options. Indexes and constraints remain separate types. key.setColumnsNames(null); key.getColumns().add(new KeyElement("id")); Validation Regression coverage exercises indexes, primary keys, unique keys, foreign keys and exclusion constraints, with null/empty clears, collection/varargs appenders and direct structured-list edits. Both toString() and StatementDeParser preserve the restored SQL and key options; rendered statements reparse successfully. Default PMD complexity and field-placement rules: zero violations for the changed shared interface. Java 17 offline Gradle spotlessApply check: 10,045 tests, 10,020 passed, 25 skipped, zero failures/errors. Grammar, Checkstyle, PMD, SpotBugs and coverage checks pass. Integration validation Applied #2770, #2771 and all four follow-ups (#2775–#2778) together on master (066f581e), resolving overlapping validator edits while preserving their respective behavior. The integrated build passes Java 17 offline Gradle spotlessApply check: 10,141 tests, 10,116 passed, 25 skipped, zero failures/errors. The combined ALTER validator has zero findings under the default PMD complexity and field-placement rules. Replayed 882 previously DB-validated MySQL/PostgreSQL DDL fixtures: 875 pass and the same seven existing parse gaps remain. SQL output, reparsing and AST node-type sets match the preceding integration baseline, with no new differences. This replay did not rerun the databases. The published head passes grammar checks, Gradle and Maven on Ubuntu/Windows/macOS, and Codacy. Deployment-only jobs are skipped as expected for a PR.
Open Graph Description: Purpose Allow callers to clear an index or constraint's legacy column names and then repopulate its structured key list. Today key.setColumnsNames(null) followed by addColumns(...) throws Unsup...
X Description: Purpose Allow callers to clear an index or constraint's legacy column names and then repopulate its structured key list. Today key.setColumnsNames(null) followed by addColumns(...) throws U...
Opengraph URL: https://github.com/JSQLParser/JSqlParser/pull/2775
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
| 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:596b9659-0e78-92de-c9da-01ac20fd5316 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | A40E:22CC3D:28770:366CB:6B04923C |
| html-safe-nonce | 65d9854bc925b743157775577dff17ecb785b48620540dd26ef6d930220eac71 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNDBFOjIyQ0MzRDoyODc3MDozNjZDQjo2QjA0OTIzQyIsInZpc2l0b3JfaWQiOiI4MjAzMDIyODc3MjUyMTYyMTA4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 56c58829cfed861439dabae8f8951a86e9f0dc0c2550d863b9d5dd5363af716c |
| hovercard-subject-tag | pull_request:4819881379 |
| 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/2775/files |
| twitter:image | https://avatars.githubusercontent.com/u/55116920?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/55116920?s=400&v=4 |
| og:image:alt | Purpose Allow callers to clear an index or constraint's legacy column names and then repopulate its structured key list. Today key.setColumnsNames(null) followed by addColumns(...) throws Unsup... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9b297275a74a2c9a35898175c9477837c635d4f579277ebff3b2d6ebd012e247 |
| 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 full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | b51ce57ca6d4565a42856fc1c9897077c794597f |
| 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