susanin [
https://community.jboss.org/people/susanin] created the discussion
"How can I instrument access only to a specific array"
To view the discussion, visit:
https://community.jboss.org/message/740677#740677
--------------------------------------------------------------
Hi,
I have a class which has one field of an array type, e.g.
class Pojo {
int[] ids = new int[100];
....
}
I'd like to replace only accesses to this specific array by means of Javassist.
From what I see so far in the replaceArrayAccess API, one can only
replace access to all arrays of a certain type, e.g. to all int arrays. Does it mean that
there is no way to instrument only access to a sepecific array? Is there some sort of a
technical limitation related to this?
What can be workarounds or approaches to instrument only something specific? Or may be
instrument all accesses but determine at runtime if this is something specific being
accessed (how this can be done effectively?) and reacting differently only in this case?
Thanks,
Leo
--------------------------------------------------------------
Reply to this message by going to Community
[
https://community.jboss.org/message/740677#740677]
Start a new discussion in Javassist at Community
[
https://community.jboss.org/choose-container!input.jspa?contentType=1&...]