unloggedio / unlogged-sdk

Unlogged SDK for recording code execution
https://unlogged.io
Apache License 2.0
152 stars 16 forks source link

Methods that have the same name will share the same map/counter in selective logging #83

Closed TheAmg closed 1 week ago

TheAmg commented 1 week ago

Describe the bug

If there are 2 methods in the same class with the same name but different jvm signatures, they will share the same map/counter in the context of selective logging.

Example : Process counter is set to "2". Class A has methods m1() and m1(int) [same names but different signatures]

DirectInvoking m1() will yield a candidate, calling m1(int) right after that will not.

Reproduction steps

  1. Run unlogged-spring-maven-demo with a counter of your choice
  2. DirectInvoke generateReferralCode from org.unlogged.demo.utils.ReferralUtils -> generates candidate
  3. DirectInvoke generateReferralCode(int customLimit) next, there will be no candidate

Expected behavior

For methods with different signatures to have different counters/maps.

Additional context

No response

kartikeytewari-ul commented 1 week ago

This is fixed with SDK v0.6.102 and can be tested. Video Demo is here.

TheAmg commented 1 week ago

This is no longer happening on sdk 0.6.102. Closing.