From 2c1714bac4193c22089e4442c3145b6760e5b52d Mon Sep 17 00:00:00 2001 From: minleejae Date: Wed, 28 Oct 2026 16:16:50 +0900 Subject: [PATCH] build: exclude the generated CCJSqlParser from JaCoCo Instrumented by JaCoCo, the generated CCJSqlParser class is close to the 65,535 constant-pool limit (808 entries left on c84ad0ebc). 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 #2866. Signed-off-by: minleejae --- build.gradle | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index a853a8c711..7d041af278 100644 --- a/build.gradle +++ b/build.gradle @@ -276,7 +276,9 @@ test { jvmArgs = ['-Xss4m', '--add-opens=java.base/java.lang=ALL-UNNAMED'] jacoco { - excludes = ['net/sf/jsqlparser/parser/CCJSqlParserTokenManager'] + // the generated parser exceeds the constant-pool limit once instrumented (#2866) + excludes = ['net/sf/jsqlparser/parser/CCJSqlParserTokenManager', + 'net/sf/jsqlparser/parser/CCJSqlParser'] } } @@ -291,13 +293,23 @@ jacocoTestReport { csv.required = false html.outputLocation = layout.buildDirectory.dir('reports/jacoco') } + // the classes that are not instrumented, see test.jacoco + afterEvaluate { + classDirectories.setFrom(files(classDirectories.files.collect { + fileTree(dir: it, exclude: [ + "**/parser/CCJSqlParserTokenManager.class", + "**/parser/CCJSqlParser.class" + ]) + })) + } } jacocoTestCoverageVerification { - // Jacoco can't handle the TokenManager class + // Jacoco can't handle the TokenManager and the generated parser classes afterEvaluate { classDirectories.setFrom(files(classDirectories.files.collect { fileTree(dir: it, exclude: [ - "**CCJSqlParserTokenManager**" + "**/parser/CCJSqlParserTokenManager.class", + "**/parser/CCJSqlParser.class" ]) })) }