[kaffe] Re: LinkedList.subList severely broken

Daniel Bonniot Daniel.Bonniot at inria.fr
Wed May 21 14:44:01 PDT 2003


>
>
>> 		super(list, index);
>> 		elem = list.get(index);
>>
>>Which one is considered better?
>>    
>>
>
>simpler code is always better in my opinion. Easier to write, easier to
>understand, easier to change.
>
I quite agree!

I attach a corresponding patch, with a changelog entry.

The code 'list.get(index)' was obviously type incorrect, since it 
retrieved the contained value instead of the containing node. I had to 
use the findIndex method instead, whose visibility I changed from 
private to default. I don't think it matters much, since in LinkedList 
head and tail are already default, so direct manipulation from outside 
the class is already allowed.

I was quite surprised at the behaviour of the build system when some 
code in a library class doesn't compile. It seems that the class (and 
those that require it) are simply left out of rt.jar, but the build does 
not fail. Is there a good reason to do this? I would prefer to see the 
build fail.

Regarding Dalibor's patch queue status message: shouldn't my patch be 
applied in any case (merge reverted or not). It fixes a class 
(LinkedListIterator) which was not taken from Classpath. I don't know if 
this bug hapened not be to exercised before, or was just undiscovered. 
But the class is wrong anyway.

What will happen to the testcase? Has it been / will it be added to 
Kaffe testsuite (I have no idea what the format is)? Or better, to mauve 
(I could do it, if I though anybody card to include it)? Does one of 
Kaffe's developer has write access on Mauve (that would seem to make 
sense) ? Or is every VM mostly working on their own testsuite?

Cheers,

Daniel

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: LinkedListIterator.diff
Url: http://kaffe.org/pipermail/kaffe/attachments/20030521/d0133f11/attachment-0002.txt 


More information about the kaffe mailing list