Feature request: Unique Identifier per Advice application
See original GitHub issueGiven a class like this:
public class Foo {
public void foo1() {}
public void foo2() {}
}
If I write advice that instruments each public method in Foo
, there is not a simple way to uniquely identify the advice for each method. I suggest something like this:
@Advice.Pointcut int unscopedUniqueIdentifier
@Advice.Pointcut(Foo.class) int fooScopedUniqueIdentifier
I expect this would be implemented via a shared AtomicInteger per the scope provided. The ID could be injected as a constant into the bytecode and probably regenerated each time a retransformation occurs.
The alternative would be to use a combination of class and method name + signature mapping to an ID, but that would be much less performant.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
How To Manage Feature Requests [Template included]
This guide will teach you everything about feature requests – how to process them, manage them, respond to them, prioritize them – so...
Read more >Best practices for unique identifiers - Android Developers
This document provides guidance for selecting appropriate identifiers for your app based on your use case. For a general look at Android permissions, ......
Read more >Feature Requests: How to Track, Prioritize, and Manage - Pipefy
Feature requests are demands for improvement in a company's product. Click to learn how to track and prioritize these requests efficiently!
Read more >possible to log a unique id per request/response?
Hello, does anyone know of a trivial way to log a unique or semi-unique such as scalar($self-req) identifier for a request? The problem...
Read more >10 Tips to Improve Your Feature Request Responses - Nicereply
Feature requests don't need to be a sore spot for your customers or your CSAT—you just need to help everyone feel heard.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Have a look at the unit tests, they should reflect any possible use case. Other then that, have a look at Mockito. We inject unique ids per mock maker in there. Mockito only defines a hand full of advice, so it should be easy to find by looking for the
@Advice
annotations there.Cool. Do you know of any examples you could point me to?