Initialize WeakMapProvider even earlier
It is used by classes delcared as static fields in AgentInstaller, so there were some cases where the fallback is being used.
This commit is contained in:
parent
70e4525131
commit
f9f0438e85
|
@ -20,6 +20,11 @@ import net.bytebuddy.utility.JavaModule;
|
|||
|
||||
@Slf4j
|
||||
public class AgentInstaller {
|
||||
static {
|
||||
// WeakMap is used by other classes below, so we need to register the provider first.
|
||||
registerWeakMapProvider();
|
||||
}
|
||||
|
||||
public static final DDLocationStrategy LOCATION_STRATEGY = new DDLocationStrategy();
|
||||
public static final AgentBuilder.PoolStrategy POOL_STRATEGY = new DDCachingPoolStrategy();
|
||||
private static volatile Instrumentation INSTRUMENTATION;
|
||||
|
@ -41,7 +46,6 @@ public class AgentInstaller {
|
|||
public static ResettableClassFileTransformer installBytebuddyAgent(
|
||||
final Instrumentation inst, final AgentBuilder.Listener... listeners) {
|
||||
INSTRUMENTATION = inst;
|
||||
registerWeakMapProvider();
|
||||
|
||||
AgentBuilder agentBuilder =
|
||||
new AgentBuilder.Default()
|
||||
|
|
Loading…
Reference in New Issue