inspectit-ocelot icon indicating copy to clipboard operation
inspectit-ocelot copied to clipboard

Changing an instrumentation rule without changing scopes forces retransformation of involved classes

Open JonasKunz opened this issue 6 years ago • 0 comments

In theory, a class only needs to be retransformed if (a) the special sensors changed or (b) a method got hooked or unhooked. A classes' bytecode does not need to be altered if the actions of a given hook changed. However, currently changing the entry or exit actions of a rule causes all classes which are matches by the rule to be retransformed. The reason is that the actions contribute to InstrumentationRule's equals method, which in turn contributes to the ClassInstrumentationConfiguration's equals method. The easiest fix imo would be to simply to store a list of signatures representing hooked method in the ClassInstrumentationConfiguration instead of the actually matched rules.

JonasKunz avatar Feb 25 '19 07:02 JonasKunz