Skip to content

Commit 03538f0

Browse files
Copilotxiang17
andauthored
Add -XDaddTypeAnnotationsToSymbol=true for Error Prone 2.45.0+ JDK 21 compatibility (#4584)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: xiang17 <9310587+xiang17@users.noreply.github.com>
1 parent 1c8f3c1 commit 03538f0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

buildSrc/src/main/kotlin/ai.errorprone-conventions.gradle.kts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ val disableErrorProne = properties["disableErrorProne"]?.toString()?.toBoolean()
1313
tasks {
1414
withType<JavaCompile>().configureEach {
1515
with(options) {
16+
// Error Prone 2.45.0+ requires this flag when running on JDK 21
17+
// See: https://github.com/google/error-prone/releases/tag/v2.45.0
18+
compilerArgs.add("-XDaddTypeAnnotationsToSymbol=true")
19+
1620
errorprone {
1721
if (disableErrorProne) {
1822
logger.warn("Errorprone has been disabled. Build may not result in a valid PR build.")

0 commit comments

Comments
 (0)