I have the following two class definitions:
public class myclass {
private int priv;
public int f1;
public int f2;
public static int stat=5;
public myclass () {
f1=7;
}
public void setF2(int i) {
f2=i;
}
public int getF2() {
return f2;
}
}
public class mysubclass extends myclass {
public int sub1;
}
I execute the following Tcl code to introspect my two classes, and there
seems to be some kind of inconsistency. java::info on mysubclass
returns all of its fields as well as its parents; however it seems that
I can't use java::field to actually get/set the values of those fields:
% package require java
1.2.5
% java::info fields -type mysubclass
{int f1} {int f2} {int sub1}
% java::info fields -type -static mysubclass
{int stat}
% set obj [java::new mysubclass]
java0x1
% java::field $obj sub1
0
% java::field $obj f1
field "f1" doesn't exist
% java::field $obj stat
field "stat" doesn't exist
If I mess around with the parent class containing those fields, things
work out:
% java::field myclass stat
5
% set sobj [java::new myclass]
java0x2
% java::field $sobj stat
5
This seems to be a big bug to me. Am I doing something wrong, or is
there something wrong with Blend? Thanks.
-Sandeep
--
---------------------------------------------------------------------------
Sandeep V. Tamhankar Email: [EMAIL PROTECTED]
Software Engineer Phone: (650) 210-0103
Ajuba Solutions http://www.ajubasolutions.com
----------------------------------------------------------------
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