Ignore classes in java.lang.invoke in early instrumentations (#13602)

This commit is contained in:
Lauri Tulmin 2025-03-27 18:58:15 +02:00 committed by GitHub
parent 7e5d4cc8b3
commit 5626e25bb1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 3 deletions

View File

@ -56,7 +56,6 @@ import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.logging.LogManager;
import java.util.logging.Logger;
import java.util.stream.Stream;
@ -227,8 +226,11 @@ public class AgentInstaller {
AgentBuilder.Identified.Extendable extendableAgentBuilder =
agentBuilder
.ignore(
target -> instrumentationInstalled, // turn off after instrumentation is installed
Objects::nonNull)
target ->
// turn off after instrumentation is installed, exclude classes in
// java.lang.invoke to avoid circularity when bootstrapping indy instrumentation
instrumentationInstalled
|| target.getTypeName().startsWith("java.lang.invoke."))
.type(none())
.transform(
(builder, typeDescription, classLoader, module, protectionDomain) -> builder);