[Bluej-discuss] Terminal Window .. safety belt needed...
Gordon Royle
gordon at csse.uwa.edu.au
Tue Apr 4 14:46:02 BST 2006
After this afternoon's student lab, I realize that there is one
feature I would like for the Terminal Window .. a safety feature...
I am getting my students just to do some routine for-loop tasks such
as printing out to the terminal window something like
10 9 8 7 6 5 4 3 2 1
so they can get used to writing i-- instead of i++ and so on.
But of course, they try things like
for (int i=10; i>0; i++) {
System.out.print(i);
}
which in this case (or rather these cases!) led to major system
meltdown..
Not only could I not stop the system with the BlueJ features
(Terminate Thread or Reset VM) because there was simply no response
from clicking on the barber's pole, but I couldn't even stop it with
Task Manager (these particular students had chosen to use Win XP) and
indeed could not even do Shut Down so ended up having to power-cycle
the computer. One guy ended up doing it four times, though to be fair
he is not the sharpest tool in the shed...
So, maybe the Terminal Window could come with an optional limit on
the amount of output from a single method call.... if this limit (say
10K characters or something like that) is exceeded then it could
either just stop trying to display it, or even fancier, pop up a
dialog and ask the user if they wish to continue or to terminate the
thread...
Cheers
Gordon
More information about the bluej-discuss
mailing list