raphw / byte-buddy

Runtime code generation for the Java virtual machine.
https://bytebuddy.net
Apache License 2.0
6.23k stars 804 forks source link

InjectionStrategy.UsingUnsafe.OfFactory #1651

Closed githubcheng2978 closed 6 days ago

githubcheng2978 commented 4 months ago

I wrote ClassInjector.UsingUnsafe.Factory factory = ClassInjector.UsingUnsafe.Factory.resolve(instrumentation); factory.make(null, null).injectRaw(classesTypeMap); Then the code agentBuilder.with(new AgentBuilder.InjectionStrategy.UsingUnsafe.OfFactory(factory)) seems redundant

raphw commented 4 months ago

Not sure what you mean. The agent builder uses the factory to inject auxiliary types. Of course you can also use it directly.