File tree 1 file changed +6
-10
lines changed
1 file changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -344,23 +344,19 @@ compile time for it to work.
344
344
Use of ` VirtualField ` requires the ` muzzle-generation ` gradle plugin. Failing to use the plugin will result in
345
345
ClassNotFoundException when trying to access the field.
346
346
347
- ### Why we don't use ByteBuddy @Advice .Origin Method
347
+ ### Avoid using @Advice .Origin Method
348
348
349
- Instead of
349
+ You shouldn't use ByteBuddy's @Advice .Origin Method method, as it
350
+ inserts a call to ` Class.getMethod(...) ` in a transformed method.
350
351
351
- ```
352
- @Advice.Origin Method method
353
- ```
352
+ Instead, get the declaring class and method name, as loading
353
+ constants from a constant pool is a much simpler operation.
354
354
355
- we prefer to use
355
+ For example:
356
356
357
357
```
358
358
@Advice.Origin("#t") Class<?> declaringClass,
359
359
@Advice.Origin("#m") String methodName
360
360
```
361
361
362
- because the former inserts a call to ` Class.getMethod(...) ` in transformed method. In contrast,
363
- getting the declaring class and method name is just loading constants from constant pool, which is
364
- a much simpler operation.
365
-
366
362
[ suppress ] : https://opentelemetry.io/docs/instrumentation/java/automatic/agent-config/#suppressing-specific-auto-instrumentation
You can’t perform that action at this time.
0 commit comments