Probekit - Showing ObjectID [message #92123] |
Fri, 02 February 2007 16:06 |
Eclipse User |
|
|
|
Originally posted by: aheydarn.cs.uwaterloo.ca
Hi,
As we may know, an object has an ID (e.g., hashCode()) during its runtime.
Could you please let me know how I can change the EntryExit probe to publish
the object ID of the class as well?
For example:
System.out.println("Entered: " + myClassName + "." + myMethodName + ", " +
myObjectID);
Thank you so much,
Best Regards,
Abbas
|
|
|
Re: Probekit - Showing ObjectID [message #92175 is a reply to message #92123] |
Mon, 05 February 2007 17:15 |
Eclipse User |
|
|
|
Originally posted by: aheydarn.cs.uwaterloo.ca
Hi,
To solve my problem, I defined a variable objectID of type thisObject. Then,
in the output, I printed System.identityHashCode(objectID);
However, the problem of this approach is that variables of type thisObject
return null for constructors and static methods. Is there any other way that
can help me to find the hashCode of objects even for constructors and static
methods? For example, objects have an ID when we debug an application in the
Eclipse environment. I want to have such an ID for my runtime objects.
Any kind of help is greatly appreciated,
Best Regards,
Abbas
"Abbas Heydarnoori" <aheydarn@cs.uwaterloo.ca> wrote in message
news:epvnie$ms6$1@utils.eclipse.org...
> Hi,
>
>
>
> As we may know, an object has an ID (e.g., hashCode()) during its runtime.
> Could you please let me know how I can change the EntryExit probe to
> publish the object ID of the class as well?
>
>
>
> For example:
>
> System.out.println("Entered: " + myClassName + "." + myMethodName + ", " +
> myObjectID);
>
>
>
> Thank you so much,
>
>
>
> Best Regards,
>
> Abbas
>
>
|
|
|
Re: Probekit - Showing ObjectID [message #92232 is a reply to message #92175] |
Tue, 06 February 2007 19:46 |
Eclipse User |
|
|
|
Originally posted by: nmehrega.ca.ibm.com
This is a multipart message in MIME format.
--=_alternative 006C9E348525727A_=
Content-Type: text/plain; charset="US-ASCII"
Hi Abbas,
In the case of constructors, the object hasn't been created yet so there
is no object you can get an ID from.
In the case of static methods, they're invoked via the class rather than
an object so there again is no object you can get an ID from.
Navid Mehregani
--=_alternative 006C9E348525727A_=
Content-Type: text/html; charset="US-ASCII"
<br><font size=2 face="sans-serif">Hi Abbas,</font>
<br>
<br><font size=2 face="sans-serif">In the case of constructors, the object
hasn't been created yet so there is no object you can get an ID from.</font>
<br><font size=2 face="sans-serif">In the case of static methods, they're
invoked via the class rather than an object so there again is no object
you can get an ID from.</font>
<br>
<br><font size=2 face="sans-serif">Navid Mehregani</font>
--=_alternative 006C9E348525727A_=--
|
|
|
Powered by
FUDForum. Page generated in 0.03446 seconds