File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -644,6 +644,21 @@ mavenPublishing {
644644
645645tasks. withType(JavaCompile ). configureEach {
646646 options. encoding = ' UTF-8'
647+
648+ // javac's parser is recursive descent: one stack frame per level of nesting. The generated
649+ // CCJSqlParser is nested deeply enough to exhaust the default thread stack, which surfaces as
650+ // "An exception has occurred in the compiler ... java.lang.StackOverflowError" - a compiler
651+ // crash, not a compile error, and not a bug worth reporting to Oracle.
652+ //
653+ // -Xss only takes effect at JVM launch, so the compiler has to run in its own process:
654+ // setting forkOptions without options.fork = true silently does nothing.
655+ options. fork = true
656+ options. forkOptions. jvmArgs = (options. forkOptions. jvmArgs ?: []) + [' -Xss16m' ]
657+ }
658+
659+ // javadoc parses the same sources in a forked process and hits the same wall
660+ tasks. withType(Javadoc ). configureEach {
661+ options. setJFlags((options. getJFlags() ?: []) + [' -Xss16m' ])
647662}
648663
649664remotes {
You can’t perform that action at this time.
0 commit comments