Explorar o código

Build with jdk21 (#11219)

Lauri Tulmin hai 10 meses
pai
achega
dfc79ebece
Modificáronse 30 ficheiros con 131 adicións e 62 borrados
  1. 1 1
      .github/workflows/auto-update-otel-sdk.yml
  2. 7 7
      .github/workflows/build-common.yml
  3. 1 1
      .github/workflows/build.yml
  4. 1 1
      .github/workflows/codeql-daily.yml
  5. 1 1
      .github/workflows/owasp-dependency-check-daily.yml
  6. 2 2
      .github/workflows/pr-smoke-test-fake-backend-images.yml
  7. 1 1
      .github/workflows/pr-smoke-test-servlet-images.yml
  8. 2 2
      .github/workflows/publish-smoke-test-fake-backend-images.yml
  9. 1 1
      .github/workflows/publish-smoke-test-servlet-images.yml
  10. 1 1
      .github/workflows/release.yml
  11. 1 1
      .github/workflows/reusable-muzzle.yml
  12. 1 1
      .github/workflows/reusable-smoke-test-images.yml
  13. 1 1
      .github/workflows/reusable-test-indy.yml
  14. 1 1
      .github/workflows/reusable-test-latest-deps.yml
  15. 2 2
      CONTRIBUTING.md
  16. 1 0
      conventions/src/main/kotlin/io/opentelemetry/instrumentation/gradle/OtelJavaExtension.kt
  17. 17 2
      conventions/src/main/kotlin/otel.java-conventions.gradle.kts
  18. 2 0
      custom-checks/build.gradle.kts
  19. 10 0
      instrumentation/apache-httpclient/apache-httpclient-4.3/testing/build.gradle.kts
  20. 3 3
      instrumentation/camel-2.20/javaagent-unit-tests/src/test/java/io/opentelemetry/javaagent/instrumentation/apachecamel/decorators/SanitizationTest.java
  21. 7 0
      instrumentation/elasticsearch/elasticsearch-transport-5.3/javaagent/build.gradle.kts
  22. 0 22
      instrumentation/executors/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/executors/ExecutorInstrumentationTest.java
  23. 20 0
      instrumentation/executors/jdk21-testing/build.gradle.kts
  24. 28 0
      instrumentation/executors/jdk21-testing/src/test/java/io/opentelemetry/javaagent/instrumentation/executors/VirtualThreadExecutorTest.java
  25. 1 9
      instrumentation/executors/jdk21-testing/src/test/java/io/opentelemetry/javaagent/instrumentation/executors/VirtualThreadTest.java
  26. 1 0
      instrumentation/executors/testing/src/main/java/io/opentelemetry/javaagent/instrumentation/executors/JavaAsyncChild.java
  27. 4 0
      instrumentation/grails-3.0/javaagent/build.gradle.kts
  28. 4 0
      instrumentation/zio/zio-2.0/javaagent/build.gradle.kts
  29. 8 2
      muzzle/src/main/java/io/opentelemetry/javaagent/tooling/muzzle/ReferenceMatcher.java
  30. 1 0
      settings.gradle.kts

+ 1 - 1
.github/workflows/auto-update-otel-sdk.yml

@@ -69,7 +69,7 @@ jobs:
         uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
         with:
           distribution: temurin
-          java-version: 17.0.6
+          java-version: 21
 
       - name: Setup Gradle
         uses: gradle/actions/setup-gradle@db19848a5fa7950289d3668fb053140cf3028d43 # v3.3.2

+ 7 - 7
.github/workflows/build-common.yml

@@ -35,7 +35,7 @@ jobs:
         uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
         with:
           distribution: temurin
-          java-version: 17.0.6
+          java-version: 21
 
       - name: Setup Gradle
         uses: gradle/actions/setup-gradle@db19848a5fa7950289d3668fb053140cf3028d43 # v3.3.2
@@ -68,7 +68,7 @@ jobs:
         uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
         with:
           distribution: temurin
-          java-version: 17.0.6
+          java-version: 21
 
       - name: Setup Gradle
         uses: gradle/actions/setup-gradle@db19848a5fa7950289d3668fb053140cf3028d43 # v3.3.2
@@ -138,7 +138,7 @@ jobs:
         uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
         with:
           distribution: temurin
-          java-version: 17.0.6
+          java-version: 21
 
       - name: Increase gradle daemon heap size
         run: |
@@ -220,7 +220,7 @@ jobs:
         uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
         with:
           distribution: temurin
-          java-version: 17.0.6
+          java-version: 21
 
       # vaadin 14 tests fail with node 18
       - name: Set up Node
@@ -335,7 +335,7 @@ jobs:
         uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
         with:
           distribution: temurin
-          java-version: 17.0.6
+          java-version: 21
 
       - name: Set up Gradle cache
         uses: gradle/actions/setup-gradle@db19848a5fa7950289d3668fb053140cf3028d43 # v3.3.2
@@ -388,7 +388,7 @@ jobs:
         uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
         with:
           distribution: temurin
-          java-version: 17.0.6
+          java-version: 21
 
       - name: Setup Gradle
         uses: gradle/actions/setup-gradle@db19848a5fa7950289d3668fb053140cf3028d43 # v3.3.2
@@ -411,7 +411,7 @@ jobs:
         uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
         with:
           distribution: temurin
-          java-version: 17.0.6
+          java-version: 21
 
       - name: Set up Gradle cache
         uses: gradle/actions/setup-gradle@db19848a5fa7950289d3668fb053140cf3028d43 # v3.3.2

+ 1 - 1
.github/workflows/build.yml

@@ -70,7 +70,7 @@ jobs:
         uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
         with:
           distribution: temurin
-          java-version: 17.0.6
+          java-version: 21
 
       - name: Setup Gradle
         uses: gradle/actions/setup-gradle@db19848a5fa7950289d3668fb053140cf3028d43 # v3.3.2

+ 1 - 1
.github/workflows/codeql-daily.yml

@@ -27,7 +27,7 @@ jobs:
         uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
         with:
           distribution: temurin
-          java-version: 17.0.6
+          java-version: 21
 
       - name: Initialize CodeQL
         uses: github/codeql-action/init@d39d31e687223d841ef683f52467bd88e9b21c14 # v3.25.3

+ 1 - 1
.github/workflows/owasp-dependency-check-daily.yml

@@ -22,7 +22,7 @@ jobs:
         uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
         with:
           distribution: temurin
-          java-version: 17.0.6
+          java-version: 21
 
       - name: Increase gradle daemon heap size
         run: |

+ 2 - 2
.github/workflows/pr-smoke-test-fake-backend-images.yml

@@ -22,7 +22,7 @@ jobs:
         uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
         with:
           distribution: temurin
-          java-version: 17.0.6
+          java-version: 21
 
       - name: Setup Gradle
         uses: gradle/actions/setup-gradle@db19848a5fa7950289d3668fb053140cf3028d43 # v3.3.2
@@ -49,7 +49,7 @@ jobs:
         uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
         with:
           distribution: temurin
-          java-version: 17.0.6
+          java-version: 21
 
       - name: Setup Gradle
         uses: gradle/actions/setup-gradle@db19848a5fa7950289d3668fb053140cf3028d43 # v3.3.2

+ 1 - 1
.github/workflows/pr-smoke-test-servlet-images.yml

@@ -40,7 +40,7 @@ jobs:
         uses: actions/setup-java@v4
         with:
           distribution: temurin
-          java-version: 17.0.6
+          java-version: 21
 
       - name: Set up Gradle cache
         uses: gradle/actions/setup-gradle@db19848a5fa7950289d3668fb053140cf3028d43 # v3.3.2

+ 2 - 2
.github/workflows/publish-smoke-test-fake-backend-images.yml

@@ -22,7 +22,7 @@ jobs:
         uses: actions/setup-java@v4
         with:
           distribution: temurin
-          java-version: 17.0.6
+          java-version: 21
 
       - name: Login to GitHub package registry
         uses: docker/login-action@v3
@@ -55,7 +55,7 @@ jobs:
         uses: actions/setup-java@v4
         with:
           distribution: temurin
-          java-version: 17.0.6
+          java-version: 21
 
       - name: Login to GitHub package registry
         uses: azure/docker-login@v1

+ 1 - 1
.github/workflows/publish-smoke-test-servlet-images.yml

@@ -57,7 +57,7 @@ jobs:
         uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
         with:
           distribution: temurin
-          java-version: 17.0.6
+          java-version: 21
 
       - name: Login to GitHub package registry
         uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 # v3.1.0

+ 1 - 1
.github/workflows/release.yml

@@ -83,7 +83,7 @@ jobs:
       - uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
         with:
           distribution: temurin
-          java-version: 17.0.6
+          java-version: 21
 
       - name: Setup Gradle
         uses: gradle/actions/setup-gradle@db19848a5fa7950289d3668fb053140cf3028d43 # v3.3.2

+ 1 - 1
.github/workflows/reusable-muzzle.yml

@@ -31,7 +31,7 @@ jobs:
         uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
         with:
           distribution: temurin
-          java-version: 17.0.6
+          java-version: 21
 
       - name: Setup Gradle
         uses: gradle/actions/setup-gradle@db19848a5fa7950289d3668fb053140cf3028d43 # v3.3.2

+ 1 - 1
.github/workflows/reusable-smoke-test-images.yml

@@ -47,7 +47,7 @@ jobs:
         uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
         with:
           distribution: temurin
-          java-version: 17.0.6
+          java-version: 21
 
       - name: Login to GitHub package registry
         if: inputs.publish

+ 1 - 1
.github/workflows/reusable-test-indy.yml

@@ -39,7 +39,7 @@ jobs:
         uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
         with:
           distribution: temurin
-          java-version: 17.0.6
+          java-version: 21
 
       - name: Increase gradle daemon heap size
         run: |

+ 1 - 1
.github/workflows/reusable-test-latest-deps.yml

@@ -38,7 +38,7 @@ jobs:
         uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
         with:
           distribution: temurin
-          java-version: 17.0.6
+          java-version: 21
 
       - name: Increase gradle daemon heap size
         run: |

+ 2 - 2
CONTRIBUTING.md

@@ -8,7 +8,7 @@ and discuss your ideas or propose the changes you wish to make.
 
 ## Building
 
-This project requires Java 17 to build and run tests. Newer JDK's may work, but this version is used in CI.
+This project requires Java 21 to build and run tests. Newer JDK's may work, but this version is used in CI.
 
 Some instrumentations and tests may put constraints on which java versions they support.
 See [Running the tests](./docs/contributing/running-tests.md) for more details.
@@ -22,7 +22,7 @@ the Sonatype OSS snapshots repository at `https://oss.sonatype.org/content/repos
 
 ### Building from source
 
-Build using Java 17:
+Build using Java 21:
 
 ```bash
 java -version

+ 1 - 0
conventions/src/main/kotlin/io/opentelemetry/instrumentation/gradle/OtelJavaExtension.kt

@@ -10,6 +10,7 @@ import org.gradle.api.provider.Property
 
 abstract class OtelJavaExtension {
   abstract val minJavaVersionSupported: Property<JavaVersion>
+  abstract val maxJavaVersionSupported: Property<JavaVersion>
 
   abstract val maxJavaVersionForTests: Property<JavaVersion>
 

+ 17 - 2
conventions/src/main/kotlin/otel.java-conventions.gradle.kts

@@ -27,12 +27,15 @@ afterEvaluate {
 }
 
 // Version to use to compile code and run tests.
-val DEFAULT_JAVA_VERSION = JavaVersion.VERSION_17
+val DEFAULT_JAVA_VERSION = JavaVersion.VERSION_21
 
 java {
   toolchain {
     languageVersion.set(
-      otelJava.minJavaVersionSupported.map { JavaLanguageVersion.of(Math.max(it.majorVersion.toInt(), DEFAULT_JAVA_VERSION.majorVersion.toInt())) }
+      otelJava.minJavaVersionSupported.map {
+        val defaultJavaVersion = otelJava.maxJavaVersionSupported.getOrElse(DEFAULT_JAVA_VERSION).majorVersion.toInt()
+        JavaLanguageVersion.of(Math.max(it.majorVersion.toInt(), defaultJavaVersion))
+      }
     )
   }
 
@@ -69,11 +72,18 @@ tasks.withType<JavaCompile>().configureEach {
           "-Xlint:-processing",
           // We suppress the "options" warning because it prevents compilation on modern JDKs
           "-Xlint:-options",
+          // jdk21 generates more serial warnings than previous versions
+          "-Xlint:-serial",
 
           // Fail build on any warning
           "-Werror"
         )
       )
+      val defaultJavaVersion = otelJava.maxJavaVersionSupported.getOrElse(DEFAULT_JAVA_VERSION).majorVersion.toInt()
+      if (Math.max(otelJava.minJavaVersionSupported.get().majorVersion.toInt(), defaultJavaVersion) >= 21) {
+        // new warning in jdk21
+        compilerArgs.add("-Xlint:-this-escape")
+      }
     }
 
     encoding = "UTF-8"
@@ -81,6 +91,11 @@ tasks.withType<JavaCompile>().configureEach {
     if (name.contains("Test")) {
       // serialVersionUID is basically guaranteed to be useless in tests
       compilerArgs.add("-Xlint:-serial")
+      // when code is compiled with jdk 21 and executed with jdk 8, the -parameters flag is needed to avoid
+      // java.lang.reflect.MalformedParametersException: Invalid parameter name ""
+      // when junit calls java.lang.reflect.Executable.getParameters() on the constructor of a
+      // non-static nested test class
+      compilerArgs.add("-parameters")
     }
   }
 }

+ 2 - 0
custom-checks/build.gradle.kts

@@ -36,6 +36,8 @@ tasks {
           "--add-exports",
           "jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED",
           "--add-exports",
+          "jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED",
+          "--add-exports",
           "jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED",
           "--add-exports",
           "jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED",

+ 10 - 0
instrumentation/apache-httpclient/apache-httpclient-4.3/testing/build.gradle.kts

@@ -2,6 +2,16 @@ plugins {
   id("otel.java-conventions")
 }
 
+tasks {
+  compileJava {
+    // when code is compiled with jdk 21 and executed with jdk 8 -parameters flag is needed to avoid
+    // java.lang.reflect.MalformedParametersException: Invalid parameter name ""
+    // when junit calls java.lang.reflect.Executable.getParameters() on the constructor of a
+    // non-static nested test class
+    options.compilerArgs.add("-parameters")
+  }
+}
+
 dependencies {
   api(project(":testing-common"))
 

+ 3 - 3
instrumentation/camel-2.20/javaagent-unit-tests/src/test/java/io/opentelemetry/javaagent/instrumentation/apachecamel/decorators/SanitizationTest.java

@@ -31,7 +31,7 @@ class SanitizationTest {
     when(exchange.getIn()).thenReturn(message);
 
     String actualSanitized = decorator.getStatement(exchange, null);
-    assertEquals(actualSanitized, expected);
+    assertEquals(expected, actualSanitized);
   }
 
   @ParameterizedTest
@@ -45,7 +45,7 @@ class SanitizationTest {
     when(exchange.getIn()).thenReturn(message);
 
     String actualSanitized = decorator.getStatement(exchange, null);
-    assertEquals(actualSanitized, expected);
+    assertEquals(expected, actualSanitized);
   }
 
   @ParameterizedTest
@@ -60,7 +60,7 @@ class SanitizationTest {
     when(exchange.getIn()).thenReturn(message);
 
     String actualSanitized = decorator.getStatement(exchange, null);
-    assertEquals(actualSanitized, expected);
+    assertEquals(expected, actualSanitized);
   }
 
   static class SqlArgs implements ArgumentsProvider {

+ 7 - 0
instrumentation/elasticsearch/elasticsearch-transport-5.3/javaagent/build.gradle.kts

@@ -28,6 +28,13 @@ muzzle {
   }
 }
 
+if (findProperty("testLatestDeps") as Boolean) {
+  // when running on jdk 21 Elasticsearch53SpringRepositoryTest occasionally fails with timeout
+  otelJava {
+    maxJavaVersionSupported.set(JavaVersion.VERSION_17)
+  }
+}
+
 dependencies {
   compileOnly("org.elasticsearch.client:transport:5.3.0") {
     isTransitive = false

+ 0 - 22
instrumentation/executors/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/executors/ExecutorInstrumentationTest.java

@@ -7,8 +7,6 @@ package io.opentelemetry.javaagent.instrumentation.executors;
 
 import io.opentelemetry.instrumentation.testing.junit.AgentInstrumentationExtension;
 import io.opentelemetry.instrumentation.testing.junit.InstrumentationExtension;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.List;
@@ -26,8 +24,6 @@ import java.util.concurrent.ScheduledThreadPoolExecutor;
 import java.util.concurrent.ThreadPoolExecutor;
 import java.util.concurrent.TimeUnit;
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.condition.EnabledForJreRange;
-import org.junit.jupiter.api.condition.JRE;
 import org.junit.jupiter.api.extension.RegisterExtension;
 
 abstract class ExecutorInstrumentationTest<T extends ExecutorService>
@@ -51,24 +47,6 @@ abstract class ExecutorInstrumentationTest<T extends ExecutorService>
     }
   }
 
-  @EnabledForJreRange(min = JRE.JAVA_21)
-  static class VirtualThreadExecutorTest extends ExecutorInstrumentationTest<ExecutorService> {
-    VirtualThreadExecutorTest() {
-      super(newVirtualThreadPerTaskExecutor());
-    }
-
-    private static ExecutorService newVirtualThreadPerTaskExecutor() {
-      Method newVirtualThreadPerTaskExecutor;
-      try {
-        newVirtualThreadPerTaskExecutor =
-            Executors.class.getMethod("newVirtualThreadPerTaskExecutor");
-        return (ExecutorService) newVirtualThreadPerTaskExecutor.invoke(null);
-      } catch (InvocationTargetException | NoSuchMethodException | IllegalAccessException e) {
-        throw new IllegalStateException("Should not happen on Java 21+", e);
-      }
-    }
-  }
-
   static class WorkStealingPoolTest extends ExecutorInstrumentationTest<ExecutorService> {
     public WorkStealingPoolTest() {
       super(Executors.newWorkStealingPool(2));

+ 20 - 0
instrumentation/executors/jdk21-testing/build.gradle.kts

@@ -0,0 +1,20 @@
+plugins {
+  id("otel.javaagent-testing")
+}
+
+dependencies {
+  testInstrumentation(project(":instrumentation:executors:javaagent"))
+
+  testCompileOnly(project(":instrumentation:executors:bootstrap"))
+  testImplementation(project(":instrumentation:executors:testing"))
+}
+
+otelJava {
+  minJavaVersionSupported.set(JavaVersion.VERSION_21)
+}
+
+tasks.withType<Test>().configureEach {
+  // needed for VirtualThreadTest
+  jvmArgs("--add-opens=java.base/java.lang=ALL-UNNAMED")
+  jvmArgs("-XX:+IgnoreUnrecognizedVMOptions")
+}

+ 28 - 0
instrumentation/executors/jdk21-testing/src/test/java/io/opentelemetry/javaagent/instrumentation/executors/VirtualThreadExecutorTest.java

@@ -0,0 +1,28 @@
+/*
+ * Copyright The OpenTelemetry Authors
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+package io.opentelemetry.javaagent.instrumentation.executors;
+
+import io.opentelemetry.instrumentation.testing.junit.AgentInstrumentationExtension;
+import io.opentelemetry.instrumentation.testing.junit.InstrumentationExtension;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import org.junit.jupiter.api.extension.RegisterExtension;
+
+class VirtualThreadExecutorTest
+    extends AbstractExecutorServiceTest<ExecutorService, JavaAsyncChild> {
+
+  @RegisterExtension
+  static final InstrumentationExtension testing = AgentInstrumentationExtension.create();
+
+  VirtualThreadExecutorTest() {
+    super(Executors.newVirtualThreadPerTaskExecutor(), testing);
+  }
+
+  @Override
+  protected JavaAsyncChild newTask(boolean doTraceableWork, boolean blockThread) {
+    return new JavaAsyncChild(doTraceableWork, blockThread);
+  }
+}

+ 1 - 9
instrumentation/executors/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/executors/VirtualThreadTest.java → instrumentation/executors/jdk21-testing/src/test/java/io/opentelemetry/javaagent/instrumentation/executors/VirtualThreadTest.java

@@ -12,21 +12,13 @@ import java.lang.reflect.Method;
 import java.util.concurrent.Callable;
 import java.util.concurrent.atomic.AtomicBoolean;
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.condition.EnabledForJreRange;
-import org.junit.jupiter.api.condition.JRE;
 
-@EnabledForJreRange(min = JRE.JAVA_21)
 class VirtualThreadTest {
 
   @Test
   void testDisableContextPropagation() throws Exception {
     TestRunnable testRunnable = new TestRunnable();
-    // Thread.ofVirtual().start(testRunnable);
-    Method ofVirtualMethod = Thread.class.getMethod("ofVirtual");
-    Object virtualThreadBuilder = ofVirtualMethod.invoke(null);
-    Method startVirtualThread =
-        Class.forName("java.lang.Thread$Builder").getMethod("start", Runnable.class);
-    Thread thread = (Thread) startVirtualThread.invoke(virtualThreadBuilder, testRunnable);
+    Thread thread = Thread.ofVirtual().start(testRunnable);
     thread.join();
 
     assertThat(testRunnable.error).isNull();

+ 1 - 0
instrumentation/executors/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/executors/JavaAsyncChild.java → instrumentation/executors/testing/src/main/java/io/opentelemetry/javaagent/instrumentation/executors/JavaAsyncChild.java

@@ -11,6 +11,7 @@ import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.ForkJoinTask;
 import java.util.concurrent.atomic.AtomicBoolean;
 
+@SuppressWarnings("serial")
 final class JavaAsyncChild extends ForkJoinTask<Object> implements TestTask {
   private static final Tracer tracer = GlobalOpenTelemetry.getTracer("test");
 

+ 4 - 0
instrumentation/grails-3.0/javaagent/build.gradle.kts

@@ -18,6 +18,10 @@ muzzle {
   }
 }
 
+otelJava {
+  maxJavaVersionSupported.set(JavaVersion.VERSION_17)
+}
+
 val grailsVersion = "3.0.6" // first version that the tests pass on
 val springBootVersion = "1.2.5.RELEASE"
 

+ 4 - 0
instrumentation/zio/zio-2.0/javaagent/build.gradle.kts

@@ -28,6 +28,10 @@ muzzle {
   }
 }
 
+otelJava {
+  maxJavaVersionSupported.set(JavaVersion.VERSION_17)
+}
+
 dependencies {
   compileOnly("dev.zio:zio_$scalaVersion:$zioVersion")
 

+ 8 - 2
muzzle/src/main/java/io/opentelemetry/javaagent/tooling/muzzle/ReferenceMatcher.java

@@ -294,13 +294,19 @@ public final class ReferenceMatcher {
       return null;
     }
 
+    TypeDescription superType = null;
     if (typeOnClasspath.getSuperClass() != null) {
-      MethodDescription.InDefinedShape methodOnSupertype =
-          findMethod(methodRef, typeOnClasspath.getSuperClass().asErasure());
+      superType = typeOnClasspath.getSuperClass().asErasure();
+    } else if (!"java.lang.Object".equals(typeOnClasspath.getName())) {
+      superType = TypeDescription.ForLoadedType.of(Object.class);
+    }
+    if (superType != null) {
+      MethodDescription.InDefinedShape methodOnSupertype = findMethod(methodRef, superType);
       if (methodOnSupertype != null) {
         return methodOnSupertype;
       }
     }
+
     for (TypeDescription.Generic interfaceType : typeOnClasspath.getInterfaces()) {
       MethodDescription.InDefinedShape methodOnSupertype =
           findMethod(methodRef, interfaceType.asErasure());

+ 1 - 0
settings.gradle.kts

@@ -227,6 +227,7 @@ include(":instrumentation:elasticsearch:elasticsearch-transport-common:javaagent
 include(":instrumentation:elasticsearch:elasticsearch-transport-common:testing")
 include(":instrumentation:executors:bootstrap")
 include(":instrumentation:executors:javaagent")
+include(":instrumentation:executors:jdk21-testing")
 include(":instrumentation:executors:testing")
 include(":instrumentation:external-annotations:javaagent")
 include(":instrumentation:external-annotations:javaagent-unit-tests")