Re: Know the runtime class
Andrew Huntwork <[email protected]>
| Newsgroups | gmane.comp.jakarta.bcel.user |
|---|---|
| Message-ID | <[email protected]> |
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] >