GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — JaCoCo instrumentation of CCJSqlParser is approaching the constant-pool limit · Issue #2866 · JSQLParser/JSqlParser Open DescriptionProblemOn current master ( When the limit is exceeded, JaCoCo fails with This happened on 2026-10-23 while combining grammar changes from #2847–#2849. Moving helpers into nested classes avoided the limit, but the remaining capacity is still small. Current master passes. Root causeThe generated parser contains 5,591 methods, including 3,515 Measured on
Grammar additions can increase both the generated class size and the probe count.
Proposed short-term fixExclude only
test {
jacoco {
- excludes = ['net/sf/jsqlparser/parser/CCJSqlParserTokenManager']
+ excludes = ['net/sf/jsqlparser/parser/CCJSqlParserTokenManager',
+ 'net/sf/jsqlparser/parser/CCJSqlParser']
}
}
jacocoTestReport {
...
+ 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
afterEvaluate {
classDirectories.setFrom(files(classDirectories.files.collect {
fileTree(dir: it, exclude: [
- "**CCJSqlParserTokenManager**"
+ "**/parser/CCJSqlParserTokenManager.class",
+ "**/parser/CCJSqlParser.class"
])
}))
}The exact class exclusion keeps nested parser helpers, such as I also found that the existing Verified on current master with all 12,262 tests:
These numbers change because two classes leave the calculation, not because coverage improves:
Both configurations pass the existing coverage thresholds. Trade-off: We lose direct coverage measurements for the generated parser, including its grammar branches. However, all parser tests still run, and other classes, including nested helpers, remain covered. If the parser is split later (see below), the exclusion can be reverted. Longer-term solution: split the generated parserExcluding the parser from JaCoCo addresses the immediate issue. The parser itself, however, already uses 46,304 constant-pool entries without instrumentation, and javac fails with "too many constants" beyond 65,535. For comparison, it used 12,266 in 5.3 and 34,231 in 5.4. Two contributors to its size are:
I tested a small proof of concept that moves the
The new inner class uses 17,060 entries and has 48,454 left after instrumentation. The parser remains instrumented, and preliminary performance measurements showed no clear difference (not a JMH benchmark). This would require a change in the JavaCC 8 generator ( If this direction is interesting, I can open a separate issue in Additional notes
Measurement codeimport java.nio.file.Files; import java.nio.file.Path; import org.jacoco.core.instr.Instrumenter; import org.jacoco.core.runtime.OfflineInstrumentationAccessGenerator; public class JacocoHeadroom { public static void main(String[] args) throws Exception { byte[] original = Files.readAllBytes(Path.of(args[0])); byte[] instrumented = new Instrumenter(new OfflineInstrumentationAccessGenerator()) .instrument(original, "CCJSqlParser"); int count = ((instrumented[8] & 0xff) << 8) | (instrumented[9] & 0xff); System.out.println("constant_pool_count=" + count + " left=" + (65535 - count)); } } The agent's runtime access code differs slightly from the offline one, so treat the number as approximate. I'm happy to prepare a PR for the short-term fix if this approach is acceptable. AI assistance: prepared with Claude Code. Activity
MetadataMetadataAssigneesLabelsNo labels TypeProjectsMilestoneRelationshipsDevelopmentIssue actions | ||||||||||||||||||||||||||||||||||
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |