I have a couple of questions about your Interp patch.
In Catch.java, your patched version looks like:
result = interp.getResult();
if (argv.length == 3) {
try {
interp.setVar(argv[2], result, 0);
} catch (TclException e) {
throw new TclException(interp,
"couldn't save command result in variable");
}
}
interp.returnCode = TCL.OK;
interp.setResult(TclInteger.newInstance(code));
In the C verison of Tcl, the following appears:
if (objc == 3) {
if (Tcl_ObjSetVar2(interp, varNamePtr, NULL,
Tcl_GetObjResult(interp), 0) == NULL) {
Tcl_ResetResult(interp);
Tcl_AppendToObj(Tcl_GetObjResult(interp),
"couldn't save command result in variable", -1);
return TCL_ERROR;
}
}
/*
* Set the interpreter's object result to an integer object holding the
* integer Tcl_EvalObj result. Note that we don't bother generating a
* string representation. We reset the interpreter's object result
* to an unshared empty object and then set it to be an integer object.
*/
Tcl_ResetResult(interp);
Tcl_SetIntObj(Tcl_GetObjResult(interp), result);
return TCL_OK;
Did you try just calling interp.resetResult() ?
Why not do that instead of interp.returnCode = TCL.OK ?
When I ran the test suite again, I noticed the following
error.
==== EventAdaptor-11.1 EventAdaptor._return_Object
==== Contents of test case:
set x [java::new tcl.lang.TesterBean]
set info ""
set errorInfo ""
java::bind $x tcl.lang.Tester1Listener.method_Object {
return [java::new {Integer int} 1234]
}
set msg [list [catch {[$x fire_Object [java::null]] toString} msg]
$msg $err
orInfo]
update
list [lindex $info 0] [lindex $info 2] $msg
==== Result was:
{unknown java object "java0x4a1"} {unknown java object "java0x4a1"
(attempting to return object from binding)} {1 {invalid command name
"java0x
0"} {invalid command name "java0x0"
while executing
"[$x fire_Object [java::null]] toString"}}
---- Result should have been:
{} {} {0 1234 {}}
---- EventAdaptor-11.1 FAILED
(11.2 failed like this too).
I am not sure if this was caused by your inter changes. Could
you double check to make sure nothing you did caused this?
I am too sleepy to do it right now. Once we get these issues
resolved, I can check in your patch, it is kind of large
so I don't want to rush on this one.
Mo DeJong
Red Hat Inc
----------------------------------------------------------------
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/[email protected]