diff --git a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/ExtensionClassLoader.java b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/ExtensionClassLoader.java index 47a5a6ed0475..43a77482838c 100644 --- a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/ExtensionClassLoader.java +++ b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/ExtensionClassLoader.java @@ -167,7 +167,7 @@ private static void addFileUrl(List result, File file) { try { // skip shading extension classes if opentelemetry-api is not shaded (happens when using // disableShadowRelocate=true) - if (Context.class.getName().contains("shaded")) { + if (Context.class.getName().contains(".shaded.")) { URL wrappedUrl = new URL("otel", null, -1, "/", new RemappingUrlStreamHandler(file)); result.add(wrappedUrl); } else {