RE: Know the runtime class

"Chakravarthy, Srikanth" <[email protected]>
Newsgroups gmane.comp.jakarta.bcel.user
Message-ID <8ADC468FAD0DD811ABE500065BFE3CDA01004B1A@PAT>
Thanks for the reply.
Actually my problem will be solved even if I get the set S as you have
mentioned. But how do I get the set S?

Is it possible to know the implementors of a given interface using
JavaClass? Or should I use a different API? Then using this list I can
check if the object of A is an instance of B.

Thanks,
Srikanth

-----Original Message-----
From: Andrew Huntwork [mailto:[email protected]] 
Sent: 02 August 2004 15:40
To: BCEL Users List
Subject: Re: Know the runtime class

I'm pretty sure that you're describing the pointer aliasing problem, 
which is in general undecidable.  There are a lot of heuristic and 
approximation algorithms that compiler folks use, like Type-Based alias 
analysis, which I think comes in 2 flavors, flow sensitive and 
flow-insensitive.

basically, don't expect to discover that the concrete type of the field 
of type A in C is B.  Expect to discover that the concrete type of A is 
in a set S which happens to contain B.

hopefully, i'm misinterpreting your question and you're really asking 
about something that's solvable.  good luck :)

Chakravarthy, Srikanth wrote:
> Hi,
> I am creating a cross reference of classes.
> If the classes have direct relations then I get all the related
classes.
> If there is an object of an interface that will be assigned the value
of
> the implementing class then I am not able to get that class as one of
> the references.
> 
> For example: class B implements Interface A.
> In another class C, I have an object of A. Using reflection, I have
> created the object of B and assigned to object of A. 
> 
> Now, when I run my program to check the cross references for class C,
I
> do not get class B in the list as it is not directly involved with
class
> C.
> 
> Is there any way to know the instance of the object of A in the class
C?
> Which API method should I use for this?
> 
> Any help is deeply appreciated.
> 
> Thanks
> Srikanth
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.