From 062835c54c75f9edb2651853cebd37774ea30ace Mon Sep 17 00:00:00 2001 From: Rafael Winterhalter Date: Thu, 26 Oct 2023 23:59:37 +0200 Subject: [PATCH] Wrapper default type pool with lazy facade to avoid accessive caching. --- .../main/java/net/bytebuddy/agent/builder/AgentBuilder.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/byte-buddy-dep/src/main/java/net/bytebuddy/agent/builder/AgentBuilder.java b/byte-buddy-dep/src/main/java/net/bytebuddy/agent/builder/AgentBuilder.java index d199fc34d7..1373e45876 100644 --- a/byte-buddy-dep/src/main/java/net/bytebuddy/agent/builder/AgentBuilder.java +++ b/byte-buddy-dep/src/main/java/net/bytebuddy/agent/builder/AgentBuilder.java @@ -3370,7 +3370,9 @@ enum Default implements PoolStrategy { * {@inheritDoc} */ public TypePool typePool(ClassFileLocator classFileLocator, @MaybeNull ClassLoader classLoader) { - return new TypePool.Default.WithLazyResolution(TypePool.CacheProvider.Simple.withObjectType(), classFileLocator, readerMode); + return new TypePool.LazyFacade(new TypePool.Default.WithLazyResolution(TypePool.CacheProvider.Simple.withObjectType(), + classFileLocator, + readerMode)); } /**