semasoztutar
Programmer
Hi,
I have a method like this ;
a(int x){
z();
}
and another method z() which is called from a();
z(){
// I want to access the value of x.
}
When I call x(5) I want to access the value 5 in z(). But as you can see I don't want to give x to z() as an argument. So I want the method
z() to be generic.
I've been looking JVM instructions and java.lang.Runtime methods. But I couldn't find a solution.
I looked Proxy class in the reflection package, but if I use that I will have to use interfaces so I will have to write interfaces for all my classes.
It seems that I have to get JVM stack and read the parameter
values from the stack. In that case, I should use a method like fillInStackTrace() which is in the Throwable class and native. I can't find the source code of this native method.
I'm waiting for your replies. Thanks a lot.
I have a method like this ;
a(int x){
z();
}
and another method z() which is called from a();
z(){
// I want to access the value of x.
}
When I call x(5) I want to access the value 5 in z(). But as you can see I don't want to give x to z() as an argument. So I want the method
z() to be generic.
I've been looking JVM instructions and java.lang.Runtime methods. But I couldn't find a solution.
I looked Proxy class in the reflection package, but if I use that I will have to use interfaces so I will have to write interfaces for all my classes.
It seems that I have to get JVM stack and read the parameter
values from the stack. In that case, I should use a method like fillInStackTrace() which is in the Throwable class and native. I can't find the source code of this native method.
I'm waiting for your replies. Thanks a lot.