The testrecorder agent uses asm 6 for code instrumentation. Using testrecorder along with other projects using asm can lead to class loading problems if the incorrect version is loaded.
Yet if the project where testrecorder is used is really legacy code, we cannot assume that the dependencies are managed properly (just updating the version of asm would possibly not work). This means that a main scenario for using testrecorder will not be supported.
Furthermore: Testrecorder uses Bytebuddy for attaching to the jvm. Bytebuddy brings its own implementation of asm - in a separate package, so it will not cause class loader problems. If a call to BytebuddyAgent.install instruments code with the internal asm, there is another risk that on asm version can instrument the bytecode and another cannot - so it is not sufficient to fix the version of asm in the project but maybe also the version of bytebuddy.
Possible solutions could be:
use maven shade to get an own version of asm that does not conflict with other projects
get byte buddy out of the dependencies by solving the issues of Bytebuddy.install on our own.
or attach to byte buddy not only as agent but also to the library (including the shaded version of asm)
The testrecorder agent uses asm 6 for code instrumentation. Using testrecorder along with other projects using asm can lead to class loading problems if the incorrect version is loaded.
Yet if the project where testrecorder is used is really legacy code, we cannot assume that the dependencies are managed properly (just updating the version of asm would possibly not work). This means that a main scenario for using testrecorder will not be supported.
Furthermore: Testrecorder uses Bytebuddy for attaching to the jvm. Bytebuddy brings its own implementation of asm - in a separate package, so it will not cause class loader problems. If a call to
BytebuddyAgent.install
instruments code with the internal asm, there is another risk that on asm version can instrument the bytecode and another cannot - so it is not sufficient to fix the version of asm in the project but maybe also the version of bytebuddy.Possible solutions could be:
Bytebuddy.install
on our own.