>Humm, this one seems a little tricky. It was caused by the recent Channel
>rewrite. The problem is that we are writing to our own buffer before sending
>the data to System.out and that buffer is not getting flushed when the
>interp exits. I would have though the Writer classes would have a finalize()
>method that would flush the buffer, but it seems that is not implemented.
What
>do you think of the following patch? The patch turns on finalization at exit
>time and adds a finalize method to the Channel class.
Thanks Mo, I will try the changes.
The only problems I can see with this approach is that you don't
know when finalizers are called (when objects are garbage-collected)
and the runFinalizerOnExit() method is deprecated.
Also, this method works only when running the Shell and if the shell
really exists. I actually am thinking of running the interpreter from
inside a "server" environment, either by creating my own interpreter
or by "calling" the Shell main method and catching the System.exit()
(and so making the runFinalizerOnExit() quite ineffective.
Anyway, I'll play with it and see what I can come up with.
Thanks,
Raffaele
|