Uploaded image for project: 'Magnolia'
  1. Magnolia
  2. MAGNOLIA-7893

ByteBuddyMutableWrapperHelper does not cache the generated proxy classes

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Neutral
    • Resolution: Fixed
    • Affects Version/s: 6.2.3
    • Fix Version/s: 6.2.4
    • Component/s: None
    • Labels:
    • Release notes required:
      Yes
    • Sprint:
      Maintenance 27

      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.

        Checklists

        Acceptance criteria

          Attachments

            Activity

              People

              Assignee:
              apchelintcev Aleksandr Pchelintcev
              Reporter:
              apchelintcev Aleksandr Pchelintcev
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Checklists

                  Bug DoR
                  DoD

                    Time Tracking

                    Estimated:
                    Original Estimate - Not Specified
                    Not Specified
                    Remaining:
                    Remaining Estimate - Not Specified
                    Not Specified
                    Logged:
                    Time Spent - 8m
                    8m