Skip to content

Commit 773b9b7

Browse files
committed
Disable Error Prone on JDK 26
Issue: google/error-prone#5200
1 parent a372c5c commit 773b9b7

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

gradle/libs.versions.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@ bndlib = { module = "biz.aQute.bnd:biz.aQute.bndlib", version.ref = "bnd" }
3434
checkstyle = { module = "com.puppycrawl.tools:checkstyle", version.ref = "checkstyle" }
3535
classgraph = { module = "io.github.classgraph:classgraph", version = "4.8.181" }
3636
commons-io = { module = "commons-io:commons-io", version = "2.20.0" }
37+
38+
# check whether JDK 26 condition in junitbuild.java-nullability-conventions.gradle.kts can be removed when updating
3739
errorProne-core = { module = "com.google.errorprone:error_prone_core", version = "2.41.0" }
40+
3841
fastcsv = { module = "de.siegmar:fastcsv", version = "4.0.0" }
3942
groovy4 = { module = "org.apache.groovy:groovy", version = "4.0.28" }
4043
groovy2-bom = { module = "org.codehaus.groovy:groovy-bom", version = "2.5.23" }

gradle/plugins/common/src/main/kotlin/junitbuild.java-nullability-conventions.gradle.kts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ nullaway {
2828
tasks.withType<JavaCompile>().configureEach {
2929
options.errorprone {
3030
val onJ9 = java.toolchain.implementation.orNull == JvmImplementation.J9
31-
if (name == "compileJava" && !onJ9) {
31+
// Workaround for https://github.com/google/error-prone/issues/5200
32+
val onJdk26 = java.toolchain.languageVersion.get() >= JavaLanguageVersion.of(26)
33+
val shouldDisableErrorProne = onJ9 || onJdk26
34+
if (name == "compileJava" && !shouldDisableErrorProne) {
3235
disable(
3336

3437
// This check is opinionated wrt. which method names it considers unsuitable for import which includes
@@ -56,7 +59,7 @@ tasks.withType<JavaCompile>().configureEach {
5659
disableAllChecks = true
5760
}
5861
nullaway {
59-
if (onJ9) {
62+
if (shouldDisableErrorProne) {
6063
disable()
6164
} else {
6265
enable()

0 commit comments

Comments
 (0)