ByteBuddyMutableWrapperHelper does not cache the generated proxy classes

Description

Unlike other cases of ByteBuddy library usage (e.g. ByteBuddyI18nIzer) ByteBuddyMutableWrapperHelper) doesn't use TypeCache to prevent the mutators from being generated for the same classes over and over.

Actually resulting proxy anyway use the getter/setter delegate (invoker) that accepts the wrapped instance. Effectively the wrapper classes can be cached already.

The only issue out there is that ByteBuddy builder configures delegation to a concrete interceptor that takes a concrete instance-bound invoker, which "bakes" in the connection to a concrete instance from the generated proxy. The solution to this problem is very simple: do not pass the invoker explicitly to the DefaultInterceptor's constructor, rather inject it as an argument into intercept method via _INVOKER field, which we anyway set.

Activity

Show:
Fixed

Details

Assignee

Reporter

Priority

Labels

Fix versions

Affects versions

Sprint

More fields

Created September 30, 2020 at 2:39 PM
Updated August 26, 2021 at 11:12 AM
Resolved October 6, 2020 at 1:17 PM