java.util.Vector clear() problem

Nic Ferrier kaffe@rufus.w3.org
Fri, 05 May 2000 19:15:51 +0100


I think 've found a problem with java.util.Vector.clear()

When there is one element in the vector the method fails (possibly
also when there are more elements).

The problem is actually caused by:

   AbstractList.removeRange()

removeRange() uses the list's iterator to iterate over the list and
remove each element but it does not seem to initialize the list
correctly.

The offending code is something like:

  while(condition && iterator.hasNext())
  {
     iterator.remove(index);
     index++;
  }

and I think it needs to be like this:

  while(condition && iterator.hasNext())
  {
     iterator.next();
     iterator.remove(index);
     index++;
  }


Whilst we're on the subject I can't get the java libraries to
compile.

They don't seem to get compiled with the make of the whole kaffe
target and when I use the rebuildLib script with all the java source
files I get lots of compile errors.

Is there a readme anywhere describing the make procedure for the java
libs?



Nic Ferrier