Closed jimshowalter closed 6 months ago
Thanks for that. Could you create a QA for this? I'm cleaning out the issue tracker every now and then.
What is a QA?
The example doesn't use a TypeCache. Instead it just uses a ConcurrentHashMap + computeIfAbsent. Is that bad? Should it be changed to use a TypeCache?
I mean discussions: https://github.com/raphw/byte-buddy/discussions
Using a type cache, you allow for garbage collection which is not possible otherwise.
I'll move this to discussions.
We wouldn't ever need to GC a ByteBuddy-generated subclass, because we need them for as long as the pod is running.
Attached is a complete example of how to add modified-fields tracking to classes using ByteBuddy.
It was cobbled together from byte-buddy javadocs, https://bytebuddy.net/#/tutorial, issues reported here, and various StackOverflows, over a couple of weeks.
It might be useful to have a single working example available somewhere that can be used to get a holistic understanding of how the pieces fit together.
You're welcome to use the attached example for that.
byte-buddy-example.zip