Merge the AdviceTemplate in the Sermant framework and no longer set a unique Template for the Bootstrap class #1234
Labels
area/framework
Issues or PRs releated to sermant core service
kind/enhancement
Issues or PRs releated to sermant enhancement
Milestone
What would you like to be added?
Merge AdviceTemplate in the Sermant framework, merge AdviceConstTemplate, AdviceMemberTemplate, AdviceStaticTemplate and BootstrapConstTemplate, BootstrapMemberTemplate, BootstrapStaticTemplate
Why is this needed?
**For the ordinary class AdviceTemplate will be added to the bytecode file of the class during bytecode enhancement: **
"INTERCEPTOR_MAP$SERMANT", "EXT_STATIC_FIELDS$SERMANT", "EXT_MEMBER_FIELDS$SERMANT" static fields, this will affect:
**For Bootstrap classes, BootstrapTemplate will be added to the class when bytecode is enhanced: **
static { ClassLoader.getSystemClassLoader().loadClass("net.bytebuddy.dynamic.Nexus").getMethod("initialize", Class.class, Integer.TYPE).invoke((Object)null, StringBuilder.class, -1854685050); }
The following static code block will have the following effects:
This static code block is added for the ByteBuddy framework. If you want to disable it, you need to enable "disableClassFormatChanges" of ByteBuddy.AgentBuilder, which will strictly comply with the limitations of the Instrumentation API. This will cause the AdviceTemplate for ordinary classes to be unusable and throw an exception.
AdviceTemplate for Bootstrap class will use reflection when using Interceptor, which will affect the performance of bytecode enhancement
The text was updated successfully, but these errors were encountered: