A couple of things to check first: - getSelectedIndex() should probably return -1 if no items are selected, not 0. - in delItem, if the last item is deleted, but it was selected, it looks like an ArrayIndexOutOfBoundsException will be thrown - what happens in select() if multiple mode is false and another index is already selected? should be call deselect() here?
I'll test out the patch and maybe write some more tests for this stuff. --Tony On Wed, 2006-07-26 at 10:53 -0400, Tania Bento wrote: > Hey, > > This patch now makes a few of harmony's test suites now pass on > classpath. The main problem was that 'selected' was not being updated > in a couple of necessary methods. I have also committed some mauve > tests (gnu.testlet.java.awt.List.testSelected.java). The other minor > modifications were also based on harmony's test suites. > > If someone could kindly review this patch and approve and/or comment on > it, that would be great. > > Thanks. > Tania > > 2006-07-26 Tania Bento <[EMAIL PROTECTED]> > > * java/awt/List.java > Initialized private variable visibleIndex to -1. > (addItem(String, int)): If string is null, it should be > set to the empty string. > (addItem(String, int)): If int < -1, it should be > set to -1. > (delItem): If the item to be deleted was selected, the > next item on the list automatically is selected. > (delItems): Checks are not necessarily and all indices > in selected should be deleted. > (getSelectedIndex): If selected == null, 0 should be > returned. > (select): Updated selected. > (deselect): Updated selected. > > >
