java.util.Vector clear() problem

Nic Ferrier nferrier at tapsellferrier.co.uk
Fri May 5 11:15:51 PDT 2000


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


More information about the kaffe mailing list