You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I've noticed that in #2819 muzzle should have prevented the instrumentation from being applied, but it didn't: a NoSuchFieldError was thrown instead.
When you print out the muzzle references you can see that it incorrectly assigns the qs field to our helper class:
And the BasicFuseableObserver which actually owns this field only has a reference to its constructor. We don't check field access in our helper classes, so muzzle fails to recognize a mismatch in the runtime.
What did you expect to see?
Muzzle should assign the field to the class that actually defines it.
The text was updated successfully, but these errors were encountered:
For field access this.qs compiler generates bytecode where field owner is the type of this even when the field is in super class. This behaviour is the same for methods and static fields, owner is whatever the type is that access is performed on, actual field owner is resolved during runtime.
Are you suggesting that we somehow try to figure out the actual owner of field/method?
Yeah, figuring this out in compile time would be pretty pretty hard. We could do something else: in the runtime ReferenceMatcher we have access to the application classloader (via BB TypePool) and we can check if a field that we have a reference to exists in one of the super classes. If not, we have a mismatch.
Describe the bug
I've noticed that in #2819 muzzle should have prevented the instrumentation from being applied, but it didn't: a
NoSuchFieldError
was thrown instead.When you print out the muzzle references you can see that it incorrectly assigns the
qs
field to our helper class:And the
BasicFuseableObserver
which actually owns this field only has a reference to its constructor. We don't check field access in our helper classes, so muzzle fails to recognize a mismatch in the runtime.What did you expect to see?
Muzzle should assign the field to the class that actually defines it.
The text was updated successfully, but these errors were encountered: