Bug & Patch

Maurizio DE CECCO maurizio at mandrakesoft.com
Tue Mar 28 06:54:51 PST 2000



On kaffe 1.0.5:

1)  I noticed a bug in quite a complex situation.

In a AWT application, if a subprocess is run before existing returning
the Main method/thread, successive running other sub processes later
from AWT event handler produce some problem; notably, calling process.waitFor()
wait forever also if the process is finished.

Well, no idea why .... and i was not able (yet) to produce a small
example to reproduce the problem; anyway, if anybody saw something
similar please tell me ...

2) In a TextField, some keys (on a USA keyboard the backquote, but
depends on the keyboard) cause an ArrayIndexOutOfBound exception
in the handle method of the ShortcutHandler class, line 166 (and the caracter
in not inserted), 

I fixed the "effect", but i don't know the cause: the keycode
of the KeyEvent is negative, and the access to the codeTable 
array produce a exception.

There was already a test a few lines before to check the code
against the size, i added a test for grater than zero and everything
works; but i don't know why the keycode is negative there,
so i have no idea if the fix is the good one. 

Here is the diff:

-- snip snip ------------------------------------------------------------

diff -ru kaffe-1.0.5.org/libraries/javalib/java/awt/ShortcutHandler.java kaffe-1.0.5/libraries/javalib/java/awt/ShortcutHandler.java
--- kaffe-1.0.5.org/libraries/javalib/java/awt/ShortcutHandler.java	Mon Oct 18 07:24:15 1999
+++ kaffe-1.0.5/libraries/javalib/java/awt/ShortcutHandler.java	Tue Mar 28 11:54:40 2000
@@ -159,7 +159,7 @@
 			cc += 64;
 	}
 	
-	if ( cc >= codeTable.length )
+	if ( (cc < 0) || ( cc >= codeTable.length ))
 		return false;
 
 	MenuShortcut ms;		

-- snip snip ------------------------------------------------------------


-- 
Maurizio De Cecco
MandrakeSoft 		http://www.mandrakesoft.com/


More information about the kaffe mailing list