Skip to content

build: exclude the generated CCJSqlParser from JaCoCo - #2867

Merged
manticore-projects merged 1 commit into
JSQLParser:masterfrom
minleejae:build/jacoco-exclude-generated-parser
Oct 29, 2026
Merged

manticore-projects merged 1 commit into
JSQLParser:masterfrom
minleejae:build/jacoco-exclude-generated-parser

Conversation

@minleejae

Copy link
Copy Markdown
Contributor

Implements the short-term fix proposed in #2866. Instrumented by JaCoCo, the generated CCJSqlParser class has 808 constant-pool entries left on master (c84ad0ebc). When a grammar change crosses the limit, the agent fails with ClassTooLargeException, loads the parser uninstrumented, and jacocoTestCoverageVerification fails.

The parser is now excluded from the agent (test.jacoco.excludes), from jacocoTestReport and from jacocoTestCoverageVerification. The agent already excluded CCJSqlParserTokenManager this way. The report and verification exclusions use the exact class-file paths **/parser/CCJSqlParserTokenManager.class and **/parser/CCJSqlParser.class, so nested classes such as CCJSqlParser$ObjectNames stay instrumented and measured.

This also closes two gaps in the existing TokenManager exclusion, which together counted the uninstrumented TokenManager as 0% covered in both tasks:

  • The verification pattern **CCJSqlParserTokenManager** did not match the class-file path.
  • The report had no exclusion at all.

The coverage thresholds, the rule-level excludes and the Maven build are unchanged.

Validation:

  • Java 17 Gradle check passes: 12,262 tests with 0 failures and 25 skipped. Grammar ambiguity, formatting (Spotless ratchet against upstream/master), Checkstyle, PMD, SpotBugs and JaCoCo all pass.

  • The test execution data contains the nested CCJSqlParser$… classes but neither CCJSqlParser nor CCJSqlParserTokenManager. The HTML report lists neither class.

  • Bundle totals checked by the verification rules:

    master this change
    Instruction covered ratio 0.7537 0.8274
    Missed lines 14,892 7,336

    The numbers change because two classes leave the bundle, not because coverage improves:

    • the TokenManager: 815 lines, 0% covered;
    • the parser: 82.19% covered, 6,741 of 37,575 lines missed.

AI assistance: prepared with Claude Code.

Instrumented by JaCoCo, the generated CCJSqlParser class is close to the
65,535 constant-pool limit (808 entries left on c84ad0e). Past the
limit the agent loads it uninstrumented and the coverage verification
fails.

Exclude it from the agent, the report and the verification, like the
TokenManager. The verification pattern "**CCJSqlParserTokenManager**"
did not match the class file, so both classes are now excluded by their
exact paths, which keeps the nested helper classes measured.

See JSQLParser#2866.

Signed-off-by: minleejae <mmj9808@gmail.com>
@manticore-projects
manticore-projects merged commit 401a81a into JSQLParser:master Oct 29, 2026
10 checks passed
@manticore-projects

Copy link
Copy Markdown
Contributor

Thank you very much!

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