Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Test and Performance Tools Platform (TPTP) » Probekit - Showing ObjectID
Probekit - Showing ObjectID [message #92123] Fri, 02 February 2007 16:06 Go to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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_=--
Previous Topic:AGR is fun!
Next Topic:Agents Not Found
Goto Forum:
  


Current Time: Wed Aug 12 15:57:17 GMT 2020

Powered by FUDForum. Page generated in 0.01959 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top