List bug

Gerhard Paulus gpaulus at stud.uni-frankfurt.de
Fri Jan 8 17:27:58 PST 1999


Kaffe 1.0.b3 :

if List object is empty moving mouse over List results in 
ArrayIndexOutOfBoundsException: 0 >= 0  thrown in method
repaintItem(int)

I suppose this method could return immediately if idx >= rows.size()

libraries/javalib/java/awt/widgets/List.java :

void repaintItem( int idx) {
	int d = BORDER_WIDTH;		
	int x0 = xOffs + d +2;
	int y0 = d + ( idx - first) * rowHeight;
	int y1 = y0 + rowHeight - (rowHeight - fm.getHeight())/2 -
fm.getDescent();
		
	String s = (String)rows.elementAt( idx);    // <<< problem




More information about the kaffe mailing list