object in my package or the java library?
Hi i'm using JDI to capture MethodeEntry events, i then use the following code to get the object reference of the caller object:
ObjectReference caller =event.thread().frame(1).thisObject();
I was wondering how I can check whether the object reference returned above is from an object in my package or one which belongs to the java library:
Thanks in advance.
Can I also ask how can i get the name which has been assigned to this object within the code :
For example
Test b2 = new Test();
how can i get the name of the instance ( b2 ), i can get the fact that it's an instance of Test but not the actual name.
> Can I also ask how can i get the name which has been
> assigned to this object within the code :
> For example
>
> Test b2 = new Test();
>
> how can i get the name of the instance ( b2 ), i can
> get the fact that it's an instance of Test but not
> the actual name.
I do not believe this is possible.
> Can I also ask how can i get the name which has been
> assigned to this object within the code :
You're not assigning a name to an object. You're assigning an object reference to a variable. Big difference; case in point:
Test b1 = new Test();
Test b2 = b1;
Test b3 = b1;
// and so on...
What "name" would expect the Test object to have?
(Note, there is no one "name", but a bunch of references that each point to the same object)
Hope this helps!
~