Skip to content

refactor: share expression parsing fallback logic - #2844

Merged
manticore-projects merged 1 commit into
JSQLParser:masterfrom
minleejae:refactor/expression-parsing-fallback-20261022
Oct 22, 2026
Merged

manticore-projects merged 1 commit into
JSQLParser:masterfrom
minleejae:refactor/expression-parsing-fallback-20261022

Conversation

@minleejae

Copy link
Copy Markdown
Contributor

parseExpression and parseCondExpression duplicated the simple/complex parsing attempts. Keep one fallback path in parseExpression, delegate conditional expression parsing to it, and extract a private overload for a single configured attempt.

The first attempt still requires the complete input. A retry creates a fresh parser, reapplies the configuration callback, and honors the caller's partial-parsing setting. Public signatures and reported exception behavior are preserved.

Validation:

  • Fourteen characterization cases pass before and after the refactor, covering both APIs, partial input, configuration callbacks, fresh retry parsers, null/empty input, and exception messages and causes.
  • Maven verify on JDK 21: 11,879 tests, 25 skipped, zero failures or errors.
  • Gradle check on JDK 17: 11,897 tests, 25 skipped, zero failures or errors; grammar ambiguity, formatting, Checkstyle, PMD, SpotBugs, and coverage checks pass. The local Spotless baseline was set to upstream/master with an init script because this checkout uses a fork remote.
  • Public CCJSqlParserUtil signatures match the baseline, and the grammar is unchanged.

AI assistance: prepared with Codex.

@manticore-projects
manticore-projects merged commit 0ef5217 into JSQLParser:master Oct 22, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants