diff --git a/dependencyManagement/dependencyManagement.gradle.kts b/dependencyManagement/dependencyManagement.gradle.kts index a105a553367b..d3e510b490ed 100644 --- a/dependencyManagement/dependencyManagement.gradle.kts +++ b/dependencyManagement/dependencyManagement.gradle.kts @@ -53,7 +53,7 @@ val DEPENDENCY_SETS = listOf( ), DependencySet( "net.bytebuddy", - "1.10.18", + "1.11.2", listOf("byte-buddy", "byte-buddy-agent") ), DependencySet( diff --git a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/HelperInjector.java b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/HelperInjector.java index 73653beaf536..99bc5f45cb59 100644 --- a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/HelperInjector.java +++ b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/HelperInjector.java @@ -225,8 +225,9 @@ private void ensureModuleCanReadHelperModules(JavaModule target) { if (!target.canRead(helperModule)) { log.debug("Adding module read from {} to {}", target, helperModule); - target.modify( + ClassInjector.UsingInstrumentation.redefineModule( AgentInstaller.getInstrumentation(), + target, Collections.singleton(helperModule), Collections.emptyMap(), Collections.emptyMap(), diff --git a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/bytebuddy/AgentCachingPoolStrategy.java b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/bytebuddy/AgentCachingPoolStrategy.java index f86d99380a86..c01ebe921d58 100644 --- a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/bytebuddy/AgentCachingPoolStrategy.java +++ b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/bytebuddy/AgentCachingPoolStrategy.java @@ -100,6 +100,12 @@ public final TypePool typePool(ClassFileLocator classFileLocator, ClassLoader cl return createCachingTypePool(loaderHash, loaderRef, classFileLocator); } + @Override + public final TypePool typePool( + ClassFileLocator classFileLocator, ClassLoader classLoader, String name) { + return typePool(classFileLocator, classLoader); + } + private TypePool.CacheProvider createCacheProvider( int loaderHash, WeakReference loaderRef) { return new SharedResolutionCacheAdapter(loaderHash, loaderRef, sharedResolutionCache);