Mo DeJong wrote:

> Objects do not have types, references to objects determine what behavior
> the object will provide. In Tcl/Java you don't really have a reference
> but you "reflect" an object as a type. You need to pass in the
> java.lang.Class object that a given java.lang.Object will be reflected
> as, and it needs to be the correct class (which is not always the same
> as the one returned by Object.getClass() ).

In general, what is "the correct class?"

In particular, what is the correct class in my example:

     Object o = v.elementAt (i);
     ... ReflectObject.newInstance (interp, ???, o) ...

> I thought the docs were clear, but it sounds like they will need some
> work. Would you like to help? I have tried writing them a couple
> of times but it seems like the message is still not getting through.
>
> ...
>
> 2. If you call getClass() it will always return the most derived
>    type, this is wrong is many many ways. It can lead to problems
>    with method invocation and it will let you call methods that
>    would not be accessable in regular Java.

I would love to help, as soon as I understand what's going on. Could you provide a
small test case that erroneously uses getClass() and illustrates the problems that
can arise?

Thanks.



----------------------------------------------------------------
The TclJava mailing list is sponsored by Scriptics Corporation.
To subscribe:    send mail to [EMAIL PROTECTED]  
                 with the word SUBSCRIBE as the subject.
To unsubscribe:  send mail to [EMAIL PROTECTED] 
                 with the word UNSUBSCRIBE as the subject.
To send to the list, send email to '[EMAIL PROTECTED]'. 
An archive is available at http://www.mail-archive.com/tcljava@scriptics.com

Reply via email to