Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
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;
Expand Down Expand Up @@ -227,8 +226,11 @@ private static void installEarlyInstrumentation(
AgentBuilder.Identified.Extendable extendableAgentBuilder =
agentBuilder
.ignore(
target -> instrumentationInstalled, // turn off after instrumentation is installed
Objects::nonNull)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed the Objects::nonNull(checks that instrumentation applies only in boot loader) because it doesn't work as intended. When both type and class loader matcher are given both must match for the type to be ignored, as far as I understand here the intent was to ignore when either matches. If we want we can add the class loader check with .or(Objects::nonNull) but it shouldn't be necessary.

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);
Expand Down
Loading