From da06c53fd49b7e676ccf8a32d6655c5155c16d81 Mon Sep 17 00:00:00 2001 From: Mark Vieira Date: Fri, 5 Jan 2024 15:20:28 -0800 Subject: [PATCH] Fix thirdparty audit checks on Java 22 (#104010) (#104012) --- .../gradle/internal/precommit/ThirdPartyAuditTask.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/precommit/ThirdPartyAuditTask.java b/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/precommit/ThirdPartyAuditTask.java index a25ad34a241d4..11405cb5bc09b 100644 --- a/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/precommit/ThirdPartyAuditTask.java +++ b/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/precommit/ThirdPartyAuditTask.java @@ -59,6 +59,7 @@ import static org.gradle.api.JavaVersion.VERSION_20; import static org.gradle.api.JavaVersion.VERSION_21; +import static org.gradle.api.JavaVersion.VERSION_22; @CacheableTask public abstract class ThirdPartyAuditTask extends DefaultTask { @@ -338,8 +339,8 @@ private String runForbiddenAPIsCli() throws IOException { spec.setExecutable(javaHome.get() + "/bin/java"); } spec.classpath(getForbiddenAPIsClasspath(), classpath); - // Enable explicitly for each release as appropriate. Just JDK 20/21 for now, and just the vector module. - if (isJavaVersion(VERSION_20) || isJavaVersion(VERSION_21)) { + // Enable explicitly for each release as appropriate. Just JDK 20/21/22 for now, and just the vector module. + if (isJavaVersion(VERSION_20) || isJavaVersion(VERSION_21) || isJavaVersion(VERSION_22)) { spec.jvmArgs("--add-modules", "jdk.incubator.vector"); } spec.jvmArgs("-Xmx1g");