I have the following class
public class MyClass {
private int myAttr;
public void setAttr(int a) {
myAttr = a;
Thread.dumpStack();
}
}
Thus, I can detect any attempt to change myAttr. Well, almost anyone. It does not work when someone cheats myAttrusing a method Field.set(). How can I catch the use of Java reflections?
source
share